<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 6.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity="sha256-CTSx/A06dm1B063156EVh15m6Y67pAjZZaQc89LLSrU=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.24/fancybox/fancybox.css" integrity="sha256-vQkngPS8jiHHH0I6ABTZroZk8NPZ7b+MUReOFE9UsXQ=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"rjyblog.gitee.io","root":"/","images":"/images","scheme":"Pisces","darkmode":false,"version":"8.18.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":true,"style":null},"fold":{"enable":false,"height":500},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta property="og:type" content="website">
<meta property="og:title" content="任建勇的博客">
<meta property="og:url" content="https://rjyblog.gitee.io/page/4/index.html">
<meta property="og:site_name" content="任建勇的博客">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="Jason">
<meta property="article:tag" content="Android, Java, Kotlin, Flutter, 前端技术, 设计模式">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="https://rjyblog.gitee.io/page/4/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":true,"isPost":false,"lang":"zh-CN","comments":"","permalink":"","path":"page/4/index.html","title":""}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>任建勇的博客</title>
  








  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">任建勇的博客</h1>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-overview-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Jason"
      src="/images/avatar.png">
  <p class="site-author-name" itemprop="name">Jason</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">66</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">13</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">23</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner index posts-expand">

    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/73cf04e1.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/73cf04e1.html" class="post-title-link" itemprop="url">okhttp详解系列六：服务请求拦截器 CallServerInterceptor</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2023-08-22 17:59:38" itemprop="dateCreated datePublished" datetime="2023-08-22T17:59:38+08:00">2023-08-22</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-09-21 10:47:16" itemprop="dateModified" datetime="2023-09-21T10:47:16+08:00">2023-09-21</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/okhttp/" itemprop="url" rel="index"><span itemprop="name">okhttp</span></a>
        </span>
    </span>

  
</div>

            <div class="post-description">okhttp详解系列六：服务请求拦截器 CallServerInterceptor</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <ul>
<li><a href="/posts/78efaca4.html" title="okhttp详解系列一：开篇">okhttp详解系列一：开篇</a></li>
<li><a href="/posts/8e83ed63.html" title="okhttp详解系列二：重试重定向拦截器">okhttp详解系列二：重试重定向拦截器</a></li>
<li><a href="/posts/6e2b1d41.html" title="okhttp详解系列三：桥拦截器 BridgeInterceptor">okhttp详解系列三：桥拦截器 BridgeInterceptor</a></li>
<li><a href="/posts/37107c2e.html" title="okhttp详解系列四：缓存拦截器">okhttp详解系列四：缓存拦截器</a></li>
<li><a href="/posts/ee27d764.html" title="okhttp详解系列五：连接拦截器 ConnectInterceptor">okhttp详解系列五：连接拦截器 ConnectInterceptor</a></li>
<li><a href="/posts/73cf04e1.html" title="okhttp详解系列六：服务请求拦截器 CallServerInterceptor">okhttp详解系列六：服务请求拦截器 CallServerInterceptor</a>

</li>
</ul>
<p>服务请求拦截器会把消息请求头、请求体发送给服务端。并把服务端返回信息转换为Response。</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">class</span> <span class="title class_">CallServerInterceptor</span>(<span class="keyword">private</span> <span class="keyword">val</span> forWebSocket: <span class="built_in">Boolean</span>) : Interceptor &#123;</span><br><span class="line"></span><br><span class="line">  <span class="meta">@Throws(IOException::class)</span></span><br><span class="line">  <span class="keyword">override</span> <span class="function"><span class="keyword">fun</span> <span class="title">intercept</span><span class="params">(chain: <span class="type">Interceptor</span>.<span class="type">Chain</span>)</span></span>: Response &#123;</span><br><span class="line">    <span class="keyword">val</span> realChain = chain <span class="keyword">as</span> RealInterceptorChain</span><br><span class="line">    <span class="keyword">val</span> exchange = realChain.exchange!!</span><br><span class="line">    <span class="keyword">val</span> request = realChain.request</span><br><span class="line">    <span class="keyword">val</span> requestBody = request.body</span><br><span class="line">    <span class="keyword">val</span> sentRequestMillis = System.currentTimeMillis()</span><br><span class="line"></span><br><span class="line">    <span class="comment">// 向socket中写入请求头</span></span><br><span class="line">    exchange.writeRequestHeaders(request)</span><br><span class="line"></span><br><span class="line">    <span class="keyword">var</span> invokeStartEvent = <span class="literal">true</span></span><br><span class="line">    <span class="keyword">var</span> responseBuilder: Response.Builder? = <span class="literal">null</span></span><br><span class="line">    <span class="keyword">if</span> (HttpMethod.permitsRequestBody(request.method) &amp;&amp; requestBody != <span class="literal">null</span>) &#123;</span><br><span class="line">      <span class="comment">// If there&#x27;s a &quot;Expect: 100-continue&quot; header on the request, wait for a &quot;HTTP/1.1 100</span></span><br><span class="line">      <span class="comment">// Continue&quot; response before transmitting the request body. If we don&#x27;t get that, return</span></span><br><span class="line">      <span class="comment">// what we did get (such as a 4xx response) without ever transmitting the request body.</span></span><br><span class="line">      <span class="keyword">if</span> (<span class="string">&quot;100-continue&quot;</span>.equals(request.header(<span class="string">&quot;Expect&quot;</span>), ignoreCase = <span class="literal">true</span>)) &#123;</span><br><span class="line">        exchange.flushRequest()</span><br><span class="line">        responseBuilder = exchange.readResponseHeaders(expectContinue = <span class="literal">true</span>)</span><br><span class="line">        exchange.responseHeadersStart()</span><br><span class="line">        invokeStartEvent = <span class="literal">false</span></span><br><span class="line">      &#125;</span><br><span class="line">      <span class="keyword">if</span> (responseBuilder == <span class="literal">null</span>) &#123;</span><br><span class="line">        <span class="keyword">if</span> (requestBody.isDuplex()) &#123; <span class="comment">// 双工传输，HTTP/2才支持</span></span><br><span class="line">          <span class="comment">// Prepare a duplex body so that the application can send a request body later.</span></span><br><span class="line">          exchange.flushRequest()</span><br><span class="line">          <span class="keyword">val</span> bufferedRequestBody = exchange.createRequestBody(request, <span class="literal">true</span>).buffer()</span><br><span class="line">          requestBody.writeTo(bufferedRequestBody)</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">          <span class="comment">// Write the request body if the &quot;Expect: 100-continue&quot; expectation was met.</span></span><br><span class="line">          <span class="keyword">val</span> bufferedRequestBody = exchange.createRequestBody(request, <span class="literal">false</span>).buffer()</span><br><span class="line">          <span class="comment">// 消息体写入到socket</span></span><br><span class="line">          requestBody.writeTo(bufferedRequestBody)</span><br><span class="line">          bufferedRequestBody.close()</span><br><span class="line">        &#125;</span><br><span class="line">      &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">        exchange.noRequestBody()</span><br><span class="line">        <span class="keyword">if</span> (!exchange.connection.isMultiplexed) &#123;</span><br><span class="line">          <span class="comment">// If the &quot;Expect: 100-continue&quot; expectation wasn&#x27;t met, prevent the HTTP/1 connection</span></span><br><span class="line">          <span class="comment">// from being reused. Otherwise we&#x27;re still obligated to transmit the request body to</span></span><br><span class="line">          <span class="comment">// leave the connection in a consistent state.</span></span><br><span class="line">          exchange.noNewExchangesOnConnection()</span><br><span class="line">        &#125;</span><br><span class="line">      &#125;</span><br><span class="line">    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">      exchange.noRequestBody()</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> (requestBody == <span class="literal">null</span> || !requestBody.isDuplex()) &#123;</span><br><span class="line">      <span class="comment">// 刷新输出流，会调用socket的flush</span></span><br><span class="line">      exchange.finishRequest()</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">if</span> (responseBuilder == <span class="literal">null</span>) &#123;</span><br><span class="line">      responseBuilder = exchange.readResponseHeaders(expectContinue = <span class="literal">false</span>)!!</span><br><span class="line">      <span class="keyword">if</span> (invokeStartEvent) &#123;</span><br><span class="line">        exchange.responseHeadersStart()</span><br><span class="line">        invokeStartEvent = <span class="literal">false</span></span><br><span class="line">      &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">var</span> response = responseBuilder</span><br><span class="line">        .request(request)</span><br><span class="line">        .handshake(exchange.connection.handshake())</span><br><span class="line">        .sentRequestAtMillis(sentRequestMillis)</span><br><span class="line">        .receivedResponseAtMillis(System.currentTimeMillis())</span><br><span class="line">        .build()</span><br><span class="line">    <span class="keyword">var</span> code = response.code</span><br><span class="line">    <span class="keyword">if</span> (code == <span class="number">100</span>) &#123;</span><br><span class="line">      <span class="comment">// Server sent a 100-continue even though we did not request one. Try again to read the actual</span></span><br><span class="line">      <span class="comment">// response status.</span></span><br><span class="line">      responseBuilder = exchange.readResponseHeaders(expectContinue = <span class="literal">false</span>)!!</span><br><span class="line">      <span class="keyword">if</span> (invokeStartEvent) &#123;</span><br><span class="line">        exchange.responseHeadersStart()</span><br><span class="line">      &#125;</span><br><span class="line">      response = responseBuilder</span><br><span class="line">          .request(request)</span><br><span class="line">          .handshake(exchange.connection.handshake())</span><br><span class="line">          .sentRequestAtMillis(sentRequestMillis)</span><br><span class="line">          .receivedResponseAtMillis(System.currentTimeMillis())</span><br><span class="line">          .build()</span><br><span class="line">      code = response.code</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    exchange.responseHeadersEnd(response)</span><br><span class="line"></span><br><span class="line">    response = <span class="keyword">if</span> (forWebSocket &amp;&amp; code == <span class="number">101</span>) &#123;</span><br><span class="line">      <span class="comment">// Connection is upgrading, but we need to ensure interceptors see a non-null response body.</span></span><br><span class="line">      response.newBuilder()</span><br><span class="line">          .body(EMPTY_RESPONSE)</span><br><span class="line">          .build()</span><br><span class="line">    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">      response.newBuilder()</span><br><span class="line">          .body(exchange.openResponseBody(response))</span><br><span class="line">          .build()</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">if</span> (<span class="string">&quot;close&quot;</span>.equals(response.request.header(<span class="string">&quot;Connection&quot;</span>), ignoreCase = <span class="literal">true</span>) ||</span><br><span class="line">        <span class="string">&quot;close&quot;</span>.equals(response.header(<span class="string">&quot;Connection&quot;</span>), ignoreCase = <span class="literal">true</span>)) &#123;</span><br><span class="line">      exchange.noNewExchangesOnConnection()</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">if</span> ((code == <span class="number">204</span> || code == <span class="number">205</span>) &amp;&amp; response.body?.contentLength() ?: -<span class="number">1L</span> &gt; <span class="number">0L</span>) &#123;</span><br><span class="line">      <span class="keyword">throw</span> ProtocolException(</span><br><span class="line">          <span class="string">&quot;HTTP <span class="variable">$code</span> had non-zero Content-Length: <span class="subst">$&#123;response.body?.contentLength()&#125;</span>&quot;</span>)</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">return</span> response</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>这个是最后一个拦截器，从代码可以看到没有调用chain.process。但是服务请求拦截器返回的response并不是最终的response，前置的拦截器还没有完全处理完成。比如服务返回了redirect，在重试和重定向拦截器中会发起重定向，拦截器会被再次执行。</p>

          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/73cf04e1.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/ee27d764.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/ee27d764.html" class="post-title-link" itemprop="url">okhttp详解系列五：连接拦截器 ConnectInterceptor</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2023-08-21 10:04:24" itemprop="dateCreated datePublished" datetime="2023-08-21T10:04:24+08:00">2023-08-21</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-12-29 11:40:58" itemprop="dateModified" datetime="2023-12-29T11:40:58+08:00">2023-12-29</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/okhttp/" itemprop="url" rel="index"><span itemprop="name">okhttp</span></a>
        </span>
    </span>

  
</div>

            <div class="post-description">本文详细介绍了连接拦截器的处理机制，以及连接池相关的逻辑处理。</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <ul>
<li><a href="/posts/78efaca4.html" title="okhttp详解系列一：开篇">okhttp详解系列一：开篇</a></li>
<li><a href="/posts/8e83ed63.html" title="okhttp详解系列二：重试重定向拦截器">okhttp详解系列二：重试重定向拦截器</a></li>
<li><a href="/posts/6e2b1d41.html" title="okhttp详解系列三：桥拦截器 BridgeInterceptor">okhttp详解系列三：桥拦截器 BridgeInterceptor</a></li>
<li><a href="/posts/37107c2e.html" title="okhttp详解系列四：缓存拦截器">okhttp详解系列四：缓存拦截器</a></li>
<li><a href="/posts/ee27d764.html" title="okhttp详解系列五：连接拦截器 ConnectInterceptor">okhttp详解系列五：连接拦截器 ConnectInterceptor</a></li>
<li><a href="/posts/73cf04e1.html" title="okhttp详解系列六：服务请求拦截器 CallServerInterceptor">okhttp详解系列六：服务请求拦截器 CallServerInterceptor</a>

</li>
</ul>
<p>连接拦截器（ConnectInterceptor）负责与服务器建立网络连接，连接缓存池、dns解析、https证书校验等都在连接拦截器阶段来执行。连接拦截器类中的代码非常少，主要逻辑都在Exchange的初始化中：</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">object</span> ConnectInterceptor : Interceptor &#123;</span><br><span class="line">  <span class="meta">@Throws(IOException::class)</span></span><br><span class="line">  <span class="keyword">override</span> <span class="function"><span class="keyword">fun</span> <span class="title">intercept</span><span class="params">(chain: <span class="type">Interceptor</span>.<span class="type">Chain</span>)</span></span>: Response &#123;</span><br><span class="line">    <span class="keyword">val</span> realChain = chain <span class="keyword">as</span> RealInterceptorChain</span><br><span class="line">    <span class="comment">// 1. 初始化Exchange</span></span><br><span class="line">    <span class="keyword">val</span> exchange = realChain.call.initExchange(chain)</span><br><span class="line">    <span class="keyword">val</span> connectedChain = realChain.copy(exchange = exchange)</span><br><span class="line">    <span class="comment">// 2. 交给下一个拦截器进行处理，如果用户注册了网络拦截器，</span></span><br><span class="line">    <span class="comment">//  下一个拦截器就是用户注册的网络拦截器</span></span><br><span class="line">    <span class="keyword">val</span> result = connectedChain.proceed(realChain.request)</span><br><span class="line">    <span class="keyword">return</span> result</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>连接拦截器的主要时序：</p>
<pre class="mermaid">

zenuml
ConnectInterceptor.intercept {
    RealCall.initExchange {
        ExchangeCodec &#x3D; ExchangeFinder.find {
            RealConnection &#x3D; findHealthyConnection {
                findConnection
            }
            ExchangeCodec &#x3D; RealConnection.newCodec {
                if (http2) {
                    &quot;new Http2ExchangeCodec()&quot;
                } else {
                    &quot;new Http1ExchangeCodec()&quot;
                }
            }
        }
        new Exchange
    }
    RealInterceptorChain.&quot;copy(传入Exchange)&quot;
    RealInterceptorChain.&quot;proceed(把网络请求交给下一个拦截器)&quot;
}
</pre>

<h2 id="连接池查找可用连接"><a href="#连接池查找可用连接" class="headerlink" title="连接池查找可用连接"></a>连接池查找可用连接</h2><p>下面流程图是从<code>okhttp3.internal.connection.ExchangeFinder#findConnection</code>开始进行分析：</p>
<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentstyletype="text/css" height="1274px" preserveAspectRatio="none" style="width:437px;height:1274px;background:#FFFFFF;" version="1.1" viewBox="0 0 437 1274" width="437px" zoomAndPan="magnify"><defs/><g><ellipse cx="217.5" cy="20" fill="#222222" rx="10" ry="10" style="stroke:#222222;stroke-width:1.0;"/><polygon fill="#F1F1F1" points="156,100.0117,279,100.0117,291,112.8164,279,125.6211,156,125.6211,144,112.8164,156,100.0117" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="117" x="156" y="110.2222">&#26032;&#30340;&#35831;&#27714;&#19982;connection</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="123" x="156" y="123.0269">&#26159;&#21542;&#26159;&#30456;&#21516;&#30340;host&#21644;port</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="22" x="122" y="110.2222">&#19981;&#21516;</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="22" x="291" y="110.2222">&#30456;&#21516;</text><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="214" x="11" y="135.6211"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="194" x="21" y="156.7598">&#21024;&#38500;&#35813;connection&#19982;call&#20043;&#38388;&#30340;&#20851;&#32852;</text><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="180" x="28" y="237.9922"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="160" x="38" y="259.1309">&#23558;connection&#26631;&#35760;&#34987;idle&#29366;&#24577;</text><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="85" x="75.5" y="306.9609"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="65" x="85.5" y="328.0996">&#20851;&#38381;socket</text><polygon fill="#F1F1F1" points="36,189.5898,200,189.5898,212,201.5898,200,213.5898,36,213.5898,24,201.5898,36,189.5898" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="22" x="122" y="223.8003">&#20026;&#31354;</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="164" x="36" y="205.3979">connection&#20851;&#32852;&#30340;calls&#21015;&#34920;&#20026;&#31354;</text><polygon fill="#F1F1F1" points="118,360.9297,130,372.9297,118,384.9297,106,372.9297,118,360.9297" style="stroke:#181818;stroke-width:0.5;"/><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="134" x="250" y="135.6211"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="114" x="260" y="156.7598">&#22797;&#29992;&#24403;&#21069;connection</text><ellipse cx="317" cy="200.5898" fill="none" rx="11" ry="11" style="stroke:#222222;stroke-width:1.0;"/><ellipse cx="317" cy="200.5898" fill="#222222" rx="6" ry="6" style="stroke:#222222;stroke-width:1.0;"/><polygon fill="#F1F1F1" points="129.5,50,305.5,50,317.5,62.8047,305.5,75.6094,129.5,75.6094,117.5,62.8047,129.5,50" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="33" x="221.5" y="85.8198">&#19981;&#20026;&#31354;</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="139" x="129.5" y="60.2104">&#24403;&#21069;connection&#26159;&#21542;&#20026;&#31354;&#65311;</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="176" x="129.5" y="73.0151">(RealCall&#25345;&#26377;&#30340;RealConnection)</text><polygon fill="#F1F1F1" points="217.5,404.9297,229.5,416.9297,217.5,428.9297,205.5,416.9297,217.5,404.9297" style="stroke:#181818;stroke-width:0.5;"/><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="80" x="177.5" y="448.9297"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="60" x="187.5" y="470.0684">&#26597;&#25214;&#36830;&#25509;&#27744;</text><polygon fill="#F1F1F1" points="162.5,502.8984,272.5,502.8984,284.5,514.8984,272.5,526.8984,162.5,526.8984,150.5,514.8984,162.5,502.8984" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="110" x="162.5" y="518.7065">&#36830;&#25509;&#27744;&#20013;&#23384;&#22312;&#21487;&#29992;&#36830;&#25509;</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="22" x="128.5" y="512.3042">&#23384;&#22312;</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="33" x="284.5" y="512.3042">&#19981;&#23384;&#22312;</text><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="142" x="49.75" y="536.8984"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="122" x="59.75" y="558.0371">&#20851;&#32852;call&#19982;connection</text><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="152" x="44.75" y="605.8672"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="132" x="54.75" y="627.0059">&#36820;&#22238;&#36830;&#25509;&#27744;&#20013;&#25214;&#30340;&#30340;&#36830;&#25509;</text><ellipse cx="120.75" cy="685.8359" fill="none" rx="11" ry="11" style="stroke:#222222;stroke-width:1.0;"/><ellipse cx="120.75" cy="685.8359" fill="#222222" rx="6" ry="6" style="stroke:#222222;stroke-width:1.0;"/><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="175" x="226.75" y="586.9102"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="155" x="236.75" y="608.0488">&#21019;&#24314;&#36335;&#30001;&#35299;&#26512;&#22120;&#24182;&#35299;&#26512;ip&#22320;&#22336;</text><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="161" x="233.75" y="655.8789"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="141" x="243.75" y="677.0176">&#22522;&#20110;IP&#22320;&#22336;&#20877;&#27425;&#26597;&#25214;&#36830;&#25509;&#27744;</text><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="92" x="268.25" y="765.2383"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="72" x="278.25" y="786.377">&#36820;&#22238;&#21487;&#29992;&#36830;&#25509;</text><ellipse cx="314.25" cy="838.7227" fill="none" rx="11" ry="11" style="stroke:#222222;stroke-width:1.0;"/><ellipse cx="314.25" cy="838.7227" fill="#222222" rx="6" ry="6" style="stroke:#222222;stroke-width:1.0;"/><polygon fill="#F1F1F1" points="281.25,716.8359,347.25,716.8359,359.25,728.8359,347.25,740.8359,281.25,740.8359,269.25,728.8359,281.25,716.8359" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="21" x="318.25" y="751.0464">yes</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="66" x="281.25" y="732.644">&#23384;&#22312;&#21487;&#29992;&#36830;&#25509;</text><polygon fill="#F1F1F1" points="242.75,536.8984,385.75,536.8984,397.75,549.7031,385.75,562.5078,242.75,562.5078,230.75,549.7031,242.75,536.8984" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="33" x="318.25" y="572.7183">&#19981;&#20351;&#29992;</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="132" x="242.75" y="547.1089">&#20351;&#29992;&#21512;&#24182;&#36830;&#25509;&#30340;&#36335;&#30001;&#65292;&#25110;&#32773;</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="143" x="242.75" y="559.9136">&#20351;&#29992;&#24050;&#23384;&#22312;&#36335;&#30001;&#36873;&#25321;&#22120;&#30340;&#36335;&#30001;</text><polygon fill="#F1F1F1" points="314.25,891.7227,326.25,903.7227,314.25,915.7227,302.25,903.7227,314.25,891.7227" style="stroke:#181818;stroke-width:0.5;"/><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="135" x="150" y="935.7227"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="115" x="160" y="956.8613">&#21019;&#24314;&#26032;&#30340;Connection</text><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="80" x="177.5" y="989.6914"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="60" x="187.5" y="1010.8301">&#36830;&#25509;&#26381;&#21153;&#22120;</text><polygon fill="#F1F1F1" points="135.5,1043.6602,299.5,1043.6602,311.5,1056.4648,299.5,1069.2695,135.5,1069.2695,123.5,1056.4648,135.5,1043.6602" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="99" x="135.5" y="1053.8706">&#26597;&#25214;&#36830;&#25509;&#27744;&#26159;&#21542;&#23384;&#22312;</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="164" x="135.5" y="1066.6753">&#22810;&#36335;&#22797;&#29992;&#30340;connection(HTTP/2)</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="22" x="101.5" y="1053.8706">&#23384;&#22312;</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="33" x="311.5" y="1053.8706">&#19981;&#23384;&#22312;</text><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="187" x="20" y="1079.2695"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="167" x="30" y="1100.4082">&#20851;&#38381;&#26032;&#24314;connection&#30340;socket</text><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="170" x="28.5" y="1133.2383"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="150" x="38.5" y="1154.377">&#36820;&#22238;&#22810;&#36335;&#22797;&#29992;&#30340;connection</text><ellipse cx="113.5" cy="1198.207" fill="none" rx="11" ry="11" style="stroke:#222222;stroke-width:1.0;"/><ellipse cx="113.5" cy="1198.207" fill="#222222" rx="6" ry="6" style="stroke:#222222;stroke-width:1.0;"/><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="128" x="257.5" y="1079.2695"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="108" x="267.5" y="1100.4082">&#26032;&#36830;&#25509;&#25918;&#21040;&#36830;&#25509;&#27744;&#20013;</text><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="142" x="250.5" y="1133.2383"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="122" x="260.5" y="1154.377">&#20851;&#32852;call&#19982;connection</text><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="92" x="275.5" y="1187.207"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="72" x="285.5" y="1208.3457">&#36820;&#22238;&#26032;&#24314;&#36830;&#25509;</text><ellipse cx="321.5" cy="1252.1758" fill="none" rx="11" ry="11" style="stroke:#222222;stroke-width:1.0;"/><ellipse cx="321.5" cy="1252.1758" fill="#222222" rx="6" ry="6" style="stroke:#222222;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="118" x2="118" y1="271.9609" y2="306.9609"/><polygon fill="#181818" points="114,296.9609,118,306.9609,122,296.9609,118,300.9609" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="118" x2="118" y1="213.5898" y2="237.9922"/><polygon fill="#181818" points="114,227.9922,118,237.9922,122,227.9922,118,231.9922" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="212" x2="224" y1="201.5898" y2="201.5898"/><polygon fill="#181818" points="220,279.4609,224,289.4609,228,279.4609,224,283.4609" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="224" x2="224" y1="201.5898" y2="372.9297"/><line style="stroke:#181818;stroke-width:1.0;" x1="224" x2="130" y1="372.9297" y2="372.9297"/><polygon fill="#181818" points="140,368.9297,130,372.9297,140,376.9297,136,372.9297" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="118" x2="118" y1="340.9297" y2="360.9297"/><polygon fill="#181818" points="114,350.9297,118,360.9297,122,350.9297,118,354.9297" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="118" x2="118" y1="169.5898" y2="189.5898"/><polygon fill="#181818" points="114,179.5898,118,189.5898,122,179.5898,118,183.5898" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="317" x2="317" y1="169.5898" y2="189.5898"/><polygon fill="#181818" points="313,179.5898,317,189.5898,321,179.5898,317,183.5898" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="144" x2="118" y1="112.8164" y2="112.8164"/><line style="stroke:#181818;stroke-width:1.0;" x1="118" x2="118" y1="112.8164" y2="135.6211"/><polygon fill="#181818" points="114,125.6211,118,135.6211,122,125.6211,118,129.6211" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="291" x2="317" y1="112.8164" y2="112.8164"/><line style="stroke:#181818;stroke-width:1.0;" x1="317" x2="317" y1="112.8164" y2="135.6211"/><polygon fill="#181818" points="313,125.6211,317,135.6211,321,125.6211,317,129.6211" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="118" x2="118" y1="384.9297" y2="389.9297"/><line style="stroke:#181818;stroke-width:1.0;" x1="118" x2="217.5" y1="389.9297" y2="389.9297"/><line style="stroke:#181818;stroke-width:1.0;" x1="217.5" x2="217.5" y1="389.9297" y2="404.9297"/><polygon fill="#181818" points="213.5,394.9297,217.5,404.9297,221.5,394.9297,217.5,398.9297" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="217.5" x2="217.5" y1="75.6094" y2="100.0117"/><polygon fill="#181818" points="213.5,90.0117,217.5,100.0117,221.5,90.0117,217.5,94.0117" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="317.5" x2="404" y1="62.8047" y2="62.8047"/><polygon fill="#181818" points="400,229.7695,404,239.7695,408,229.7695,404,233.7695" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="404" x2="404" y1="62.8047" y2="416.9297"/><line style="stroke:#181818;stroke-width:1.0;" x1="404" x2="229.5" y1="416.9297" y2="416.9297"/><polygon fill="#181818" points="239.5,412.9297,229.5,416.9297,239.5,420.9297,235.5,416.9297" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="217.5" x2="217.5" y1="30" y2="50"/><polygon fill="#181818" points="213.5,40,217.5,50,221.5,40,217.5,44" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="217.5" x2="217.5" y1="428.9297" y2="448.9297"/><polygon fill="#181818" points="213.5,438.9297,217.5,448.9297,221.5,438.9297,217.5,442.9297" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="120.75" x2="120.75" y1="570.8672" y2="605.8672"/><polygon fill="#181818" points="116.75,595.8672,120.75,605.8672,124.75,595.8672,120.75,599.8672" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="120.75" x2="120.75" y1="639.8359" y2="674.8359"/><polygon fill="#181818" points="116.75,664.8359,120.75,674.8359,124.75,664.8359,120.75,668.8359" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="314.25" x2="314.25" y1="620.8789" y2="655.8789"/><polygon fill="#181818" points="310.25,645.8789,314.25,655.8789,318.25,645.8789,314.25,649.8789" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="314.25" x2="314.25" y1="799.207" y2="827.7227"/><polygon fill="#181818" points="310.25,817.7227,314.25,827.7227,318.25,817.7227,314.25,821.7227" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="314.25" x2="314.25" y1="740.8359" y2="765.2383"/><polygon fill="#181818" points="310.25,755.2383,314.25,765.2383,318.25,755.2383,314.25,759.2383" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="359.25" x2="371.25" y1="728.8359" y2="728.8359"/><polygon fill="#181818" points="367.25,797.7227,371.25,807.7227,375.25,797.7227,371.25,801.7227" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="371.25" x2="371.25" y1="728.8359" y2="871.7227"/><line style="stroke:#181818;stroke-width:1.0;" x1="371.25" x2="314.25" y1="871.7227" y2="871.7227"/><line style="stroke:#181818;stroke-width:1.0;" x1="314.25" x2="314.25" y1="871.7227" y2="891.7227"/><polygon fill="#181818" points="310.25,881.7227,314.25,891.7227,318.25,881.7227,314.25,885.7227" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="314.25" x2="314.25" y1="689.8477" y2="716.8359"/><polygon fill="#181818" points="310.25,706.8359,314.25,716.8359,318.25,706.8359,314.25,710.8359" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="314.25" x2="314.25" y1="562.5078" y2="586.9102"/><polygon fill="#181818" points="310.25,576.9102,314.25,586.9102,318.25,576.9102,314.25,580.9102" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="397.75" x2="411.75" y1="549.7031" y2="549.7031"/><polygon fill="#181818" points="407.75,722.3516,411.75,732.3516,415.75,722.3516,411.75,726.3516" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="411.75" x2="411.75" y1="549.7031" y2="903.7227"/><line style="stroke:#181818;stroke-width:1.0;" x1="411.75" x2="326.25" y1="903.7227" y2="903.7227"/><polygon fill="#181818" points="336.25,899.7227,326.25,903.7227,336.25,907.7227,332.25,903.7227" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="150.5" x2="120.75" y1="514.8984" y2="514.8984"/><line style="stroke:#181818;stroke-width:1.0;" x1="120.75" x2="120.75" y1="514.8984" y2="536.8984"/><polygon fill="#181818" points="116.75,526.8984,120.75,536.8984,124.75,526.8984,120.75,530.8984" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="284.5" x2="314.25" y1="514.8984" y2="514.8984"/><line style="stroke:#181818;stroke-width:1.0;" x1="314.25" x2="314.25" y1="514.8984" y2="536.8984"/><polygon fill="#181818" points="310.25,526.8984,314.25,536.8984,318.25,526.8984,314.25,530.8984" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="314.25" x2="314.25" y1="915.7227" y2="920.7227"/><line style="stroke:#181818;stroke-width:1.0;" x1="314.25" x2="217.5" y1="920.7227" y2="920.7227"/><line style="stroke:#181818;stroke-width:1.0;" x1="217.5" x2="217.5" y1="920.7227" y2="935.7227"/><polygon fill="#181818" points="213.5,925.7227,217.5,935.7227,221.5,925.7227,217.5,929.7227" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="217.5" x2="217.5" y1="482.8984" y2="502.8984"/><polygon fill="#181818" points="213.5,492.8984,217.5,502.8984,221.5,492.8984,217.5,496.8984" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="217.5" x2="217.5" y1="969.6914" y2="989.6914"/><polygon fill="#181818" points="213.5,979.6914,217.5,989.6914,221.5,979.6914,217.5,983.6914" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="113.5" x2="113.5" y1="1113.2383" y2="1133.2383"/><polygon fill="#181818" points="109.5,1123.2383,113.5,1133.2383,117.5,1123.2383,113.5,1127.2383" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="113.5" x2="113.5" y1="1167.207" y2="1187.207"/><polygon fill="#181818" points="109.5,1177.207,113.5,1187.207,117.5,1177.207,113.5,1181.207" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="321.5" x2="321.5" y1="1113.2383" y2="1133.2383"/><polygon fill="#181818" points="317.5,1123.2383,321.5,1133.2383,325.5,1123.2383,321.5,1127.2383" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="321.5" x2="321.5" y1="1167.207" y2="1187.207"/><polygon fill="#181818" points="317.5,1177.207,321.5,1187.207,325.5,1177.207,321.5,1181.207" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="321.5" x2="321.5" y1="1221.1758" y2="1241.1758"/><polygon fill="#181818" points="317.5,1231.1758,321.5,1241.1758,325.5,1231.1758,321.5,1235.1758" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="123.5" x2="113.5" y1="1056.4648" y2="1056.4648"/><line style="stroke:#181818;stroke-width:1.0;" x1="113.5" x2="113.5" y1="1056.4648" y2="1079.2695"/><polygon fill="#181818" points="109.5,1069.2695,113.5,1079.2695,117.5,1069.2695,113.5,1073.2695" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="311.5" x2="321.5" y1="1056.4648" y2="1056.4648"/><line style="stroke:#181818;stroke-width:1.0;" x1="321.5" x2="321.5" y1="1056.4648" y2="1079.2695"/><polygon fill="#181818" points="317.5,1069.2695,321.5,1079.2695,325.5,1069.2695,321.5,1073.2695" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="217.5" x2="217.5" y1="1023.6602" y2="1043.6602"/><polygon fill="#181818" points="213.5,1033.6602,217.5,1043.6602,221.5,1033.6602,217.5,1037.6602" style="stroke:#181818;stroke-width:1.0;"/><!--SRC=[ZLCzRzfG5Dtv5HvXgjJHZ5dQBQeoiY3YAAYMZM8ltQ0AgKamHIqAIQ1yjD0IfHHega3S9FmPtuUPyXTwd-_pXwXIbS4oxvrpxhdtN1jczi1CvFUa9Dn_X8gTqpLDoPbvNMDd4wX_THVEwj9vlEjcjEGh9QjkPLMLLKkiNLbT7Fe78I6LainzHKkw2vjOgOGaSMLsEaMmDvcpsLjtKOjAP4GHVAvQ2wXN4RQl6oPyg1Rq0pFImoik9aaoMBtr-S2R32CLBecktDkJTVCNAa3vsYirqZwUbu-GT8CGZZV0QdhzaR0Qb0fyqq-6wL5i8hrtte-fz_aglwigg-CRLYobOz3ozRevDlJSQyMaOqNRpU_Xcw8QYfIa3eCs1lQgCTeSET4CKoya0ZOzPTOTiig3j-omsf3DUca_iV2lknZ3-0pQ8tW_GLaw5otH1IyhK_l-hE8fyAgojsn0gnDNn7euAHwSVyXHlZFgXeSIAdCpxlsITrItuFQ669mwHp-pnxigiqwzOZcZ2TJy9v7fVbsii9DBE1-5ZDWc-OGm_1RyTWZYVVl2EdKayNh-Uxu0xIbyAgO5kEkuJktbDXt2aSs-z_yQOx0ZJuxlZM84wo1c50S5yOl8Of77mai8t_GPRCNcBWidRHkE-zWAnRfXaZuHCfZHO721_TFwy4KErP8lTdQsdpqN7w6qaJjk9fP74n41sT6o1hqzfVwlz6LK5cuR3s1DuqkK_h-z8s-RYyQdzmS0]--></g></svg>

<h2 id="连接拦截器类图结构"><a href="#连接拦截器类图结构" class="headerlink" title="连接拦截器类图结构"></a>连接拦截器类图结构</h2><?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentstyletype="text/css" height="623px" preserveAspectRatio="none" style="width:936px;height:623px;background:#FFFFFF;" version="1.1" viewBox="0 0 936 623" width="936px" zoomAndPan="magnify"><defs/><g><!--class ConnectInterceptor--><g id="elem_ConnectInterceptor"><rect fill="#F1F1F1" height="48" id="ConnectInterceptor" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="177" x="294" y="7"/><ellipse cx="309" cy="23" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M311.3438,18.6719 C310.4063,18.2344 309.8125,18.0938 308.9375,18.0938 C306.3125,18.0938 304.3125,20.1719 304.3125,22.8906 L304.3125,24.0156 C304.3125,26.5938 306.4219,28.4844 309.3125,28.4844 C310.5313,28.4844 311.6875,28.1875 312.4375,27.6406 C313.0156,27.2344 313.3438,26.7813 313.3438,26.3906 C313.3438,25.9375 312.9531,25.5469 312.4844,25.5469 C312.2656,25.5469 312.0625,25.625 311.875,25.8125 C311.4219,26.2969 311.4219,26.2969 311.2344,26.3906 C310.8125,26.6563 310.125,26.7813 309.3594,26.7813 C307.3125,26.7813 306.0156,25.6875 306.0156,23.9844 L306.0156,22.8906 C306.0156,21.1094 307.2656,19.7969 309,19.7969 C309.5781,19.7969 310.1875,19.9531 310.6563,20.2031 C311.1406,20.4844 311.3125,20.7031 311.4063,21.1094 C311.4688,21.5156 311.5,21.6406 311.6406,21.7656 C311.7813,21.9063 312.0156,22.0156 312.2344,22.0156 C312.5,22.0156 312.7656,21.875 312.9375,21.6563 C313.0469,21.5 313.0781,21.3125 313.0781,20.8906 L313.0781,19.4688 C313.0781,19.0313 313.0625,18.9063 312.9688,18.75 C312.8125,18.4844 312.5313,18.3438 312.2344,18.3438 C311.9375,18.3438 311.7344,18.4375 311.5156,18.75 L311.3438,18.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="145" x="323" y="27.8467">ConnectInterceptor</text><line style="stroke:#181818;stroke-width:0.5;" x1="295" x2="470" y1="39" y2="39"/><line style="stroke:#181818;stroke-width:0.5;" x1="295" x2="470" y1="47" y2="47"/></g><!--class RealInterceptorChain--><g id="elem_RealInterceptorChain"><rect fill="#F1F1F1" height="48" id="RealInterceptorChain" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="187" x="234" y="116"/><ellipse cx="249" cy="132" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M251.3438,127.6719 C250.4063,127.2344 249.8125,127.0938 248.9375,127.0938 C246.3125,127.0938 244.3125,129.1719 244.3125,131.8906 L244.3125,133.0156 C244.3125,135.5938 246.4219,137.4844 249.3125,137.4844 C250.5313,137.4844 251.6875,137.1875 252.4375,136.6406 C253.0156,136.2344 253.3438,135.7813 253.3438,135.3906 C253.3438,134.9375 252.9531,134.5469 252.4844,134.5469 C252.2656,134.5469 252.0625,134.625 251.875,134.8125 C251.4219,135.2969 251.4219,135.2969 251.2344,135.3906 C250.8125,135.6563 250.125,135.7813 249.3594,135.7813 C247.3125,135.7813 246.0156,134.6875 246.0156,132.9844 L246.0156,131.8906 C246.0156,130.1094 247.2656,128.7969 249,128.7969 C249.5781,128.7969 250.1875,128.9531 250.6563,129.2031 C251.1406,129.4844 251.3125,129.7031 251.4063,130.1094 C251.4688,130.5156 251.5,130.6406 251.6406,130.7656 C251.7813,130.9063 252.0156,131.0156 252.2344,131.0156 C252.5,131.0156 252.7656,130.875 252.9375,130.6563 C253.0469,130.5 253.0781,130.3125 253.0781,129.8906 L253.0781,128.4688 C253.0781,128.0313 253.0625,127.9063 252.9688,127.75 C252.8125,127.4844 252.5313,127.3438 252.2344,127.3438 C251.9375,127.3438 251.7344,127.4375 251.5156,127.75 L251.3438,127.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="155" x="263" y="136.8467">RealInterceptorChain</text><line style="stroke:#181818;stroke-width:0.5;" x1="235" x2="420" y1="148" y2="148"/><line style="stroke:#181818;stroke-width:0.5;" x1="235" x2="420" y1="156" y2="156"/></g><!--class Exchange--><g id="elem_Exchange"><rect fill="#F1F1F1" height="48" id="Exchange" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="101" x="456" y="116"/><ellipse cx="471" cy="132" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M473.3438,127.6719 C472.4063,127.2344 471.8125,127.0938 470.9375,127.0938 C468.3125,127.0938 466.3125,129.1719 466.3125,131.8906 L466.3125,133.0156 C466.3125,135.5938 468.4219,137.4844 471.3125,137.4844 C472.5313,137.4844 473.6875,137.1875 474.4375,136.6406 C475.0156,136.2344 475.3438,135.7813 475.3438,135.3906 C475.3438,134.9375 474.9531,134.5469 474.4844,134.5469 C474.2656,134.5469 474.0625,134.625 473.875,134.8125 C473.4219,135.2969 473.4219,135.2969 473.2344,135.3906 C472.8125,135.6563 472.125,135.7813 471.3594,135.7813 C469.3125,135.7813 468.0156,134.6875 468.0156,132.9844 L468.0156,131.8906 C468.0156,130.1094 469.2656,128.7969 471,128.7969 C471.5781,128.7969 472.1875,128.9531 472.6563,129.2031 C473.1406,129.4844 473.3125,129.7031 473.4063,130.1094 C473.4688,130.5156 473.5,130.6406 473.6406,130.7656 C473.7813,130.9063 474.0156,131.0156 474.2344,131.0156 C474.5,131.0156 474.7656,130.875 474.9375,130.6563 C475.0469,130.5 475.0781,130.3125 475.0781,129.8906 L475.0781,128.4688 C475.0781,128.0313 475.0625,127.9063 474.9688,127.75 C474.8125,127.4844 474.5313,127.3438 474.2344,127.3438 C473.9375,127.3438 473.7344,127.4375 473.5156,127.75 L473.3438,127.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="69" x="485" y="136.8467">Exchange</text><line style="stroke:#181818;stroke-width:0.5;" x1="457" x2="556" y1="148" y2="148"/><line style="stroke:#181818;stroke-width:0.5;" x1="457" x2="556" y1="156" y2="156"/></g><!--class ExchangeFinder--><g id="elem_ExchangeFinder"><rect fill="#F1F1F1" height="48" id="ExchangeFinder" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="146" x="104.5" y="225"/><ellipse cx="119.5" cy="241" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M121.8438,236.6719 C120.9063,236.2344 120.3125,236.0938 119.4375,236.0938 C116.8125,236.0938 114.8125,238.1719 114.8125,240.8906 L114.8125,242.0156 C114.8125,244.5938 116.9219,246.4844 119.8125,246.4844 C121.0313,246.4844 122.1875,246.1875 122.9375,245.6406 C123.5156,245.2344 123.8438,244.7813 123.8438,244.3906 C123.8438,243.9375 123.4531,243.5469 122.9844,243.5469 C122.7656,243.5469 122.5625,243.625 122.375,243.8125 C121.9219,244.2969 121.9219,244.2969 121.7344,244.3906 C121.3125,244.6563 120.625,244.7813 119.8594,244.7813 C117.8125,244.7813 116.5156,243.6875 116.5156,241.9844 L116.5156,240.8906 C116.5156,239.1094 117.7656,237.7969 119.5,237.7969 C120.0781,237.7969 120.6875,237.9531 121.1563,238.2031 C121.6406,238.4844 121.8125,238.7031 121.9063,239.1094 C121.9688,239.5156 122,239.6406 122.1406,239.7656 C122.2813,239.9063 122.5156,240.0156 122.7344,240.0156 C123,240.0156 123.2656,239.875 123.4375,239.6563 C123.5469,239.5 123.5781,239.3125 123.5781,238.8906 L123.5781,237.4688 C123.5781,237.0313 123.5625,236.9063 123.4688,236.75 C123.3125,236.4844 123.0313,236.3438 122.7344,236.3438 C122.4375,236.3438 122.2344,236.4375 122.0156,236.75 L121.8438,236.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="114" x="133.5" y="245.8467">ExchangeFinder</text><line style="stroke:#181818;stroke-width:0.5;" x1="105.5" x2="249.5" y1="257" y2="257"/><line style="stroke:#181818;stroke-width:0.5;" x1="105.5" x2="249.5" y1="265" y2="265"/></g><!--class ExchangeCodec--><g id="elem_ExchangeCodec"><rect codeline="10" fill="#F1F1F1" height="48" id="ExchangeCodec" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="147" x="433" y="225"/><ellipse cx="448" cy="241" fill="#B4A7E5" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M448.9531,237.7813 L450.6719,237.7813 C451.0625,237.7813 451.25,237.75 451.375,237.6719 C451.6406,237.5156 451.7813,237.2344 451.7813,236.9375 C451.7813,236.6719 451.6719,236.4063 451.4375,236.2344 C451.2656,236.125 451.125,236.0938 450.6719,236.0938 L445.5313,236.0938 C445.0938,236.0938 444.9688,236.1094 444.8125,236.2031 C444.5625,236.3594 444.4063,236.6563 444.4063,236.9375 C444.4063,237.2188 444.5469,237.4688 444.7656,237.6406 C444.9219,237.75 445.1094,237.7813 445.5313,237.7813 L447.25,237.7813 L447.25,244.2969 L445.5313,244.2969 C445.0938,244.2969 444.9688,244.3125 444.8125,244.4219 C444.5625,244.5781 444.4063,244.8594 444.4063,245.1563 C444.4063,245.4063 444.5469,245.6719 444.7656,245.8281 C444.9219,245.9531 445.125,246 445.5313,246 L450.6719,246 C451.4219,246 451.7813,245.7188 451.7813,245.1563 C451.7813,244.875 451.6719,244.625 451.4375,244.4531 C451.2656,244.3281 451.125,244.2969 450.6719,244.2969 L448.9531,244.2969 L448.9531,237.7813 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="115" x="462" y="245.8467">ExchangeCodec</text><line style="stroke:#181818;stroke-width:0.5;" x1="434" x2="579" y1="257" y2="257"/><line style="stroke:#181818;stroke-width:0.5;" x1="434" x2="579" y1="265" y2="265"/></g><!--class RealCall--><g id="elem_RealCall"><rect fill="#F1F1F1" height="48" id="RealCall" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="89" x="458" y="459"/><ellipse cx="473" cy="475" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M475.3438,470.6719 C474.4063,470.2344 473.8125,470.0938 472.9375,470.0938 C470.3125,470.0938 468.3125,472.1719 468.3125,474.8906 L468.3125,476.0156 C468.3125,478.5938 470.4219,480.4844 473.3125,480.4844 C474.5313,480.4844 475.6875,480.1875 476.4375,479.6406 C477.0156,479.2344 477.3438,478.7813 477.3438,478.3906 C477.3438,477.9375 476.9531,477.5469 476.4844,477.5469 C476.2656,477.5469 476.0625,477.625 475.875,477.8125 C475.4219,478.2969 475.4219,478.2969 475.2344,478.3906 C474.8125,478.6563 474.125,478.7813 473.3594,478.7813 C471.3125,478.7813 470.0156,477.6875 470.0156,475.9844 L470.0156,474.8906 C470.0156,473.1094 471.2656,471.7969 473,471.7969 C473.5781,471.7969 474.1875,471.9531 474.6563,472.2031 C475.1406,472.4844 475.3125,472.7031 475.4063,473.1094 C475.4688,473.5156 475.5,473.6406 475.6406,473.7656 C475.7813,473.9063 476.0156,474.0156 476.2344,474.0156 C476.5,474.0156 476.7656,473.875 476.9375,473.6563 C477.0469,473.5 477.0781,473.3125 477.0781,472.8906 L477.0781,471.4688 C477.0781,471.0313 477.0625,470.9063 476.9688,470.75 C476.8125,470.4844 476.5313,470.3438 476.2344,470.3438 C475.9375,470.3438 475.7344,470.4375 475.5156,470.75 L475.3438,470.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="57" x="487" y="479.8467">RealCall</text><line style="stroke:#181818;stroke-width:0.5;" x1="459" x2="546" y1="491" y2="491"/><line style="stroke:#181818;stroke-width:0.5;" x1="459" x2="546" y1="499" y2="499"/></g><!--class OkHttpClient--><g id="elem_OkHttpClient"><rect fill="#F1F1F1" height="48" id="OkHttpClient" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="129" x="438" y="568"/><ellipse cx="453" cy="584" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M455.3438,579.6719 C454.4063,579.2344 453.8125,579.0938 452.9375,579.0938 C450.3125,579.0938 448.3125,581.1719 448.3125,583.8906 L448.3125,585.0156 C448.3125,587.5938 450.4219,589.4844 453.3125,589.4844 C454.5313,589.4844 455.6875,589.1875 456.4375,588.6406 C457.0156,588.2344 457.3438,587.7813 457.3438,587.3906 C457.3438,586.9375 456.9531,586.5469 456.4844,586.5469 C456.2656,586.5469 456.0625,586.625 455.875,586.8125 C455.4219,587.2969 455.4219,587.2969 455.2344,587.3906 C454.8125,587.6563 454.125,587.7813 453.3594,587.7813 C451.3125,587.7813 450.0156,586.6875 450.0156,584.9844 L450.0156,583.8906 C450.0156,582.1094 451.2656,580.7969 453,580.7969 C453.5781,580.7969 454.1875,580.9531 454.6563,581.2031 C455.1406,581.4844 455.3125,581.7031 455.4063,582.1094 C455.4688,582.5156 455.5,582.6406 455.6406,582.7656 C455.7813,582.9063 456.0156,583.0156 456.2344,583.0156 C456.5,583.0156 456.7656,582.875 456.9375,582.6563 C457.0469,582.5 457.0781,582.3125 457.0781,581.8906 L457.0781,580.4688 C457.0781,580.0313 457.0625,579.9063 456.9688,579.75 C456.8125,579.4844 456.5313,579.3438 456.2344,579.3438 C455.9375,579.3438 455.7344,579.4375 455.5156,579.75 L455.3438,579.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="97" x="467" y="588.8467">OkHttpClient</text><line style="stroke:#181818;stroke-width:0.5;" x1="439" x2="566" y1="600" y2="600"/><line style="stroke:#181818;stroke-width:0.5;" x1="439" x2="566" y1="608" y2="608"/></g><!--class RealConnection--><g id="elem_RealConnection"><rect fill="#F1F1F1" height="48" id="RealConnection" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="146" x="230.5" y="334"/><ellipse cx="245.5" cy="350" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M247.8438,345.6719 C246.9063,345.2344 246.3125,345.0938 245.4375,345.0938 C242.8125,345.0938 240.8125,347.1719 240.8125,349.8906 L240.8125,351.0156 C240.8125,353.5938 242.9219,355.4844 245.8125,355.4844 C247.0313,355.4844 248.1875,355.1875 248.9375,354.6406 C249.5156,354.2344 249.8438,353.7813 249.8438,353.3906 C249.8438,352.9375 249.4531,352.5469 248.9844,352.5469 C248.7656,352.5469 248.5625,352.625 248.375,352.8125 C247.9219,353.2969 247.9219,353.2969 247.7344,353.3906 C247.3125,353.6563 246.625,353.7813 245.8594,353.7813 C243.8125,353.7813 242.5156,352.6875 242.5156,350.9844 L242.5156,349.8906 C242.5156,348.1094 243.7656,346.7969 245.5,346.7969 C246.0781,346.7969 246.6875,346.9531 247.1563,347.2031 C247.6406,347.4844 247.8125,347.7031 247.9063,348.1094 C247.9688,348.5156 248,348.6406 248.1406,348.7656 C248.2813,348.9063 248.5156,349.0156 248.7344,349.0156 C249,349.0156 249.2656,348.875 249.4375,348.6563 C249.5469,348.5 249.5781,348.3125 249.5781,347.8906 L249.5781,346.4688 C249.5781,346.0313 249.5625,345.9063 249.4688,345.75 C249.3125,345.4844 249.0313,345.3438 248.7344,345.3438 C248.4375,345.3438 248.2344,345.4375 248.0156,345.75 L247.8438,345.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="114" x="259.5" y="354.8467">RealConnection</text><line style="stroke:#181818;stroke-width:0.5;" x1="231.5" x2="375.5" y1="366" y2="366"/><line style="stroke:#181818;stroke-width:0.5;" x1="231.5" x2="375.5" y1="374" y2="374"/></g><!--class Http1ExchangeCodec--><g id="elem_Http1ExchangeCodec"><rect fill="#F1F1F1" height="48" id="Http1ExchangeCodec" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="189" x="412" y="334"/><ellipse cx="427" cy="350" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M429.3438,345.6719 C428.4063,345.2344 427.8125,345.0938 426.9375,345.0938 C424.3125,345.0938 422.3125,347.1719 422.3125,349.8906 L422.3125,351.0156 C422.3125,353.5938 424.4219,355.4844 427.3125,355.4844 C428.5313,355.4844 429.6875,355.1875 430.4375,354.6406 C431.0156,354.2344 431.3438,353.7813 431.3438,353.3906 C431.3438,352.9375 430.9531,352.5469 430.4844,352.5469 C430.2656,352.5469 430.0625,352.625 429.875,352.8125 C429.4219,353.2969 429.4219,353.2969 429.2344,353.3906 C428.8125,353.6563 428.125,353.7813 427.3594,353.7813 C425.3125,353.7813 424.0156,352.6875 424.0156,350.9844 L424.0156,349.8906 C424.0156,348.1094 425.2656,346.7969 427,346.7969 C427.5781,346.7969 428.1875,346.9531 428.6563,347.2031 C429.1406,347.4844 429.3125,347.7031 429.4063,348.1094 C429.4688,348.5156 429.5,348.6406 429.6406,348.7656 C429.7813,348.9063 430.0156,349.0156 430.2344,349.0156 C430.5,349.0156 430.7656,348.875 430.9375,348.6563 C431.0469,348.5 431.0781,348.3125 431.0781,347.8906 L431.0781,346.4688 C431.0781,346.0313 431.0625,345.9063 430.9688,345.75 C430.8125,345.4844 430.5313,345.3438 430.2344,345.3438 C429.9375,345.3438 429.7344,345.4375 429.5156,345.75 L429.3438,345.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="157" x="441" y="354.8467">Http1ExchangeCodec</text><line style="stroke:#181818;stroke-width:0.5;" x1="413" x2="600" y1="366" y2="366"/><line style="stroke:#181818;stroke-width:0.5;" x1="413" x2="600" y1="374" y2="374"/></g><!--class Http2ExchangeCodec--><g id="elem_Http2ExchangeCodec"><rect fill="#F1F1F1" height="48" id="Http2ExchangeCodec" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="188" x="636.5" y="334"/><ellipse cx="651.5" cy="350" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M653.8438,345.6719 C652.9063,345.2344 652.3125,345.0938 651.4375,345.0938 C648.8125,345.0938 646.8125,347.1719 646.8125,349.8906 L646.8125,351.0156 C646.8125,353.5938 648.9219,355.4844 651.8125,355.4844 C653.0313,355.4844 654.1875,355.1875 654.9375,354.6406 C655.5156,354.2344 655.8438,353.7813 655.8438,353.3906 C655.8438,352.9375 655.4531,352.5469 654.9844,352.5469 C654.7656,352.5469 654.5625,352.625 654.375,352.8125 C653.9219,353.2969 653.9219,353.2969 653.7344,353.3906 C653.3125,353.6563 652.625,353.7813 651.8594,353.7813 C649.8125,353.7813 648.5156,352.6875 648.5156,350.9844 L648.5156,349.8906 C648.5156,348.1094 649.7656,346.7969 651.5,346.7969 C652.0781,346.7969 652.6875,346.9531 653.1563,347.2031 C653.6406,347.4844 653.8125,347.7031 653.9063,348.1094 C653.9688,348.5156 654,348.6406 654.1406,348.7656 C654.2813,348.9063 654.5156,349.0156 654.7344,349.0156 C655,349.0156 655.2656,348.875 655.4375,348.6563 C655.5469,348.5 655.5781,348.3125 655.5781,347.8906 L655.5781,346.4688 C655.5781,346.0313 655.5625,345.9063 655.4688,345.75 C655.3125,345.4844 655.0313,345.3438 654.7344,345.3438 C654.4375,345.3438 654.2344,345.4375 654.0156,345.75 L653.8438,345.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="156" x="665.5" y="354.8467">Http2ExchangeCodec</text><line style="stroke:#181818;stroke-width:0.5;" x1="637.5" x2="823.5" y1="366" y2="366"/><line style="stroke:#181818;stroke-width:0.5;" x1="637.5" x2="823.5" y1="374" y2="374"/></g><!--class Socket--><g id="elem_Socket"><rect fill="#F1F1F1" height="48" id="Socket" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="83" x="340" y="459"/><ellipse cx="355" cy="475" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M357.3438,470.6719 C356.4063,470.2344 355.8125,470.0938 354.9375,470.0938 C352.3125,470.0938 350.3125,472.1719 350.3125,474.8906 L350.3125,476.0156 C350.3125,478.5938 352.4219,480.4844 355.3125,480.4844 C356.5313,480.4844 357.6875,480.1875 358.4375,479.6406 C359.0156,479.2344 359.3438,478.7813 359.3438,478.3906 C359.3438,477.9375 358.9531,477.5469 358.4844,477.5469 C358.2656,477.5469 358.0625,477.625 357.875,477.8125 C357.4219,478.2969 357.4219,478.2969 357.2344,478.3906 C356.8125,478.6563 356.125,478.7813 355.3594,478.7813 C353.3125,478.7813 352.0156,477.6875 352.0156,475.9844 L352.0156,474.8906 C352.0156,473.1094 353.2656,471.7969 355,471.7969 C355.5781,471.7969 356.1875,471.9531 356.6563,472.2031 C357.1406,472.4844 357.3125,472.7031 357.4063,473.1094 C357.4688,473.5156 357.5,473.6406 357.6406,473.7656 C357.7813,473.9063 358.0156,474.0156 358.2344,474.0156 C358.5,474.0156 358.7656,473.875 358.9375,473.6563 C359.0469,473.5 359.0781,473.3125 359.0781,472.8906 L359.0781,471.4688 C359.0781,471.0313 359.0625,470.9063 358.9688,470.75 C358.8125,470.4844 358.5313,470.3438 358.2344,470.3438 C357.9375,470.3438 357.7344,470.4375 357.5156,470.75 L357.3438,470.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="51" x="369" y="479.8467">Socket</text><line style="stroke:#181818;stroke-width:0.5;" x1="341" x2="422" y1="491" y2="491"/><line style="stroke:#181818;stroke-width:0.5;" x1="341" x2="422" y1="499" y2="499"/></g><!--class RealConnectionPool--><g id="elem_RealConnectionPool"><rect fill="#F1F1F1" height="48" id="RealConnectionPool" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="177" x="128" y="459"/><ellipse cx="143" cy="475" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M145.3438,470.6719 C144.4063,470.2344 143.8125,470.0938 142.9375,470.0938 C140.3125,470.0938 138.3125,472.1719 138.3125,474.8906 L138.3125,476.0156 C138.3125,478.5938 140.4219,480.4844 143.3125,480.4844 C144.5313,480.4844 145.6875,480.1875 146.4375,479.6406 C147.0156,479.2344 147.3438,478.7813 147.3438,478.3906 C147.3438,477.9375 146.9531,477.5469 146.4844,477.5469 C146.2656,477.5469 146.0625,477.625 145.875,477.8125 C145.4219,478.2969 145.4219,478.2969 145.2344,478.3906 C144.8125,478.6563 144.125,478.7813 143.3594,478.7813 C141.3125,478.7813 140.0156,477.6875 140.0156,475.9844 L140.0156,474.8906 C140.0156,473.1094 141.2656,471.7969 143,471.7969 C143.5781,471.7969 144.1875,471.9531 144.6563,472.2031 C145.1406,472.4844 145.3125,472.7031 145.4063,473.1094 C145.4688,473.5156 145.5,473.6406 145.6406,473.7656 C145.7813,473.9063 146.0156,474.0156 146.2344,474.0156 C146.5,474.0156 146.7656,473.875 146.9375,473.6563 C147.0469,473.5 147.0781,473.3125 147.0781,472.8906 L147.0781,471.4688 C147.0781,471.0313 147.0625,470.9063 146.9688,470.75 C146.8125,470.4844 146.5313,470.3438 146.2344,470.3438 C145.9375,470.3438 145.7344,470.4375 145.5156,470.75 L145.3438,470.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="145" x="157" y="479.8467">RealConnectionPool</text><line style="stroke:#181818;stroke-width:0.5;" x1="129" x2="304" y1="491" y2="491"/><line style="stroke:#181818;stroke-width:0.5;" x1="129" x2="304" y1="499" y2="499"/></g><!--class Address--><g id="elem_Address"><rect fill="#F1F1F1" height="48" id="Address" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="89" x="32" y="334"/><ellipse cx="47" cy="350" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M49.3438,345.6719 C48.4063,345.2344 47.8125,345.0938 46.9375,345.0938 C44.3125,345.0938 42.3125,347.1719 42.3125,349.8906 L42.3125,351.0156 C42.3125,353.5938 44.4219,355.4844 47.3125,355.4844 C48.5313,355.4844 49.6875,355.1875 50.4375,354.6406 C51.0156,354.2344 51.3438,353.7813 51.3438,353.3906 C51.3438,352.9375 50.9531,352.5469 50.4844,352.5469 C50.2656,352.5469 50.0625,352.625 49.875,352.8125 C49.4219,353.2969 49.4219,353.2969 49.2344,353.3906 C48.8125,353.6563 48.125,353.7813 47.3594,353.7813 C45.3125,353.7813 44.0156,352.6875 44.0156,350.9844 L44.0156,349.8906 C44.0156,348.1094 45.2656,346.7969 47,346.7969 C47.5781,346.7969 48.1875,346.9531 48.6563,347.2031 C49.1406,347.4844 49.3125,347.7031 49.4063,348.1094 C49.4688,348.5156 49.5,348.6406 49.6406,348.7656 C49.7813,348.9063 50.0156,349.0156 50.2344,349.0156 C50.5,349.0156 50.7656,348.875 50.9375,348.6563 C51.0469,348.5 51.0781,348.3125 51.0781,347.8906 L51.0781,346.4688 C51.0781,346.0313 51.0625,345.9063 50.9688,345.75 C50.8125,345.4844 50.5313,345.3438 50.2344,345.3438 C49.9375,345.3438 49.7344,345.4375 49.5156,345.75 L49.3438,345.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="57" x="61" y="354.8467">Address</text><line style="stroke:#181818;stroke-width:0.5;" x1="33" x2="120" y1="366" y2="366"/><line style="stroke:#181818;stroke-width:0.5;" x1="33" x2="120" y1="374" y2="374"/></g><!--class Dns--><g id="elem_Dns"><rect fill="#F1F1F1" height="48" id="Dns" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="59" x="34" y="459"/><ellipse cx="49" cy="475" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M51.3438,470.6719 C50.4063,470.2344 49.8125,470.0938 48.9375,470.0938 C46.3125,470.0938 44.3125,472.1719 44.3125,474.8906 L44.3125,476.0156 C44.3125,478.5938 46.4219,480.4844 49.3125,480.4844 C50.5313,480.4844 51.6875,480.1875 52.4375,479.6406 C53.0156,479.2344 53.3438,478.7813 53.3438,478.3906 C53.3438,477.9375 52.9531,477.5469 52.4844,477.5469 C52.2656,477.5469 52.0625,477.625 51.875,477.8125 C51.4219,478.2969 51.4219,478.2969 51.2344,478.3906 C50.8125,478.6563 50.125,478.7813 49.3594,478.7813 C47.3125,478.7813 46.0156,477.6875 46.0156,475.9844 L46.0156,474.8906 C46.0156,473.1094 47.2656,471.7969 49,471.7969 C49.5781,471.7969 50.1875,471.9531 50.6563,472.2031 C51.1406,472.4844 51.3125,472.7031 51.4063,473.1094 C51.4688,473.5156 51.5,473.6406 51.6406,473.7656 C51.7813,473.9063 52.0156,474.0156 52.2344,474.0156 C52.5,474.0156 52.7656,473.875 52.9375,473.6563 C53.0469,473.5 53.0781,473.3125 53.0781,472.8906 L53.0781,471.4688 C53.0781,471.0313 53.0625,470.9063 52.9688,470.75 C52.8125,470.4844 52.5313,470.3438 52.2344,470.3438 C51.9375,470.3438 51.7344,470.4375 51.5156,470.75 L51.3438,470.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="27" x="63" y="479.8467">Dns</text><line style="stroke:#181818;stroke-width:0.5;" x1="35" x2="92" y1="491" y2="491"/><line style="stroke:#181818;stroke-width:0.5;" x1="35" x2="92" y1="499" y2="499"/></g><!--class DnsSystem--><g id="elem_DnsSystem"><rect fill="#F1F1F1" height="48" id="DnsSystem" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="113" x="7" y="568"/><ellipse cx="22" cy="584" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M24.3438,579.6719 C23.4063,579.2344 22.8125,579.0938 21.9375,579.0938 C19.3125,579.0938 17.3125,581.1719 17.3125,583.8906 L17.3125,585.0156 C17.3125,587.5938 19.4219,589.4844 22.3125,589.4844 C23.5313,589.4844 24.6875,589.1875 25.4375,588.6406 C26.0156,588.2344 26.3438,587.7813 26.3438,587.3906 C26.3438,586.9375 25.9531,586.5469 25.4844,586.5469 C25.2656,586.5469 25.0625,586.625 24.875,586.8125 C24.4219,587.2969 24.4219,587.2969 24.2344,587.3906 C23.8125,587.6563 23.125,587.7813 22.3594,587.7813 C20.3125,587.7813 19.0156,586.6875 19.0156,584.9844 L19.0156,583.8906 C19.0156,582.1094 20.2656,580.7969 22,580.7969 C22.5781,580.7969 23.1875,580.9531 23.6563,581.2031 C24.1406,581.4844 24.3125,581.7031 24.4063,582.1094 C24.4688,582.5156 24.5,582.6406 24.6406,582.7656 C24.7813,582.9063 25.0156,583.0156 25.2344,583.0156 C25.5,583.0156 25.7656,582.875 25.9375,582.6563 C26.0469,582.5 26.0781,582.3125 26.0781,581.8906 L26.0781,580.4688 C26.0781,580.0313 26.0625,579.9063 25.9688,579.75 C25.8125,579.4844 25.5313,579.3438 25.2344,579.3438 C24.9375,579.3438 24.7344,579.4375 24.5156,579.75 L24.3438,579.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="81" x="36" y="588.8467">DnsSystem</text><line style="stroke:#181818;stroke-width:0.5;" x1="8" x2="119" y1="600" y2="600"/><line style="stroke:#181818;stroke-width:0.5;" x1="8" x2="119" y1="608" y2="608"/></g><!--link ConnectInterceptor to RealInterceptorChain--><g id="link_ConnectInterceptor_RealInterceptorChain"><path codeline="1" d="M370.566,55.217 C361.34,73.165 351.3729,92.5556 342.1539,110.4916 " fill="none" id="ConnectInterceptor-to-RealInterceptorChain" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="339.411,115.828,347.0829,109.652,341.6967,111.381,339.9677,105.9949,339.411,115.828" style="stroke:#181818;stroke-width:1.0;"/></g><!--link ConnectInterceptor to Exchange--><g id="link_ConnectInterceptor_Exchange"><path codeline="2" d="M409.406,55.217 C430.205,73.165 454.3185,93.9721 475.1035,111.9081 " fill="none" id="ConnectInterceptor-to-Exchange" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="479.646,115.828,475.4455,106.9198,475.8606,112.5614,470.219,112.9765,479.646,115.828" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link Exchange to ExchangeFinder--><g id="link_Exchange_ExchangeFinder"><path codeline="3" d="M444.2795,162.1028 C438.4965,164.0418 444.062,162.164 438.5,164 C374.989,184.96 302.575,208.215 250.161,224.932 " fill="none" id="Exchange-backto-ExchangeFinder" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="455.657,158.288,448.6967,156.4029,444.2795,162.1028,451.2399,163.9879,455.657,158.288" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link Exchange to ExchangeCodec--><g id="link_Exchange_ExchangeCodec"><path codeline="4" d="M506.5,176.217 C506.5,194.165 506.5,206.892 506.5,224.828 " fill="none" id="Exchange-backto-ExchangeCodec" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="506.5,164.217,502.5,170.217,506.5,176.217,510.5,170.217,506.5,164.217" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link Exchange to RealCall--><g id="link_Exchange_RealCall"><path codeline="5" d="M568.665,156.3155 C682.196,186.2295 929.267,266.038 842.5,382 C806.837,429.663 630.836,462.405 547.024,475.552 " fill="none" id="Exchange-backto-RealCall" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="557.061,153.258,561.8438,158.6547,568.665,156.3155,563.8821,150.9188,557.061,153.258" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link RealCall to OkHttpClient--><g id="link_RealCall_OkHttpClient"><path codeline="7" d="M502.5,519.217 C502.5,537.1649 502.5,549.8918 502.5,567.8279 " fill="none" id="RealCall-backto-OkHttpClient" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="502.5,507.217,498.5,513.217,502.5,519.217,506.5,513.217,502.5,507.217" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link RealConnection to RealCall--><g id="link_RealConnection_RealCall"><path codeline="8" d="M359.4021,387.0085 C377.7161,395.3165 387.589,400.547 405.5,412 C426.49,425.422 447.589,444.154 465.339,458.864 " fill="none" id="RealConnection-backto-RealCall" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="348.474,382.051,352.2856,388.1724,359.4021,387.0085,355.5905,380.887,348.474,382.051" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="8" x="350.9736" y="402.2199">1</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="24" x="428.7415" y="447.8412">0..n</text></g><!--reverse link RealCall to RealConnection--><g id="link_RealCall_RealConnection"><path codeline="9" d="M487.3935,449.7555 C474.7765,435.0455 461.49,425.422 440.5,412 C421.065,399.573 398.226,388.634 376.642,379.972 " fill="none" id="RealCall-backto-RealConnection" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="495.206,458.864,494.3359,451.7056,487.3935,449.7555,488.2636,456.9139,495.206,458.864" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link ExchangeCodec to RealConnection--><g id="link_ExchangeCodec_RealConnection"><path codeline="11" d="M451.8364,278.8125 C417.7864,296.7605 381.49,315.892 347.462,333.828 " fill="none" id="ExchangeCodec-backto-RealConnection" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="462.452,273.217,455.279,272.4762,451.8364,278.8125,459.0094,279.5533,462.452,273.217" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link ExchangeCodec to Http1ExchangeCodec--><g id="link_ExchangeCodec_Http1ExchangeCodec"><path codeline="12" d="M506.5,291.217 C506.5,309.165 506.5,315.892 506.5,333.828 " fill="none" id="ExchangeCodec-backto-Http1ExchangeCodec" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="506.5,273.217,500.5,291.217,512.5,291.217,506.5,273.217" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link ExchangeCodec to Http2ExchangeCodec--><g id="link_ExchangeCodec_Http2ExchangeCodec"><path codeline="13" d="M571.0712,280.8444 C608.7542,298.8444 644.596,315.966 682.258,333.956 " fill="none" id="ExchangeCodec-backto-Http2ExchangeCodec" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="554.829,273.086,568.485,286.2584,573.6573,275.4303,554.829,273.086" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link RealConnection to Socket--><g id="link_RealConnection_Socket"><path codeline="14" d="M287.3589,393.2645 C281.7879,407.5945 282.307,414.747 290.5,429 C296.286,439.065 318.727,452.188 339.874,462.857 " fill="none" id="RealConnection-backto-Socket" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="291.707,382.08,285.8048,386.2229,287.3589,393.2645,293.2611,389.1216,291.707,382.08" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="67" x="291.5" y="425.0669">rawSocket</text></g><!--reverse link RealConnection to Socket--><g id="link_RealConnection_Socket"><path codeline="15" d="M345.8229,389.911 C355.7249,398.289 356.604,400.74 363.5,412 C372.216,426.232 376.734,444.57 379.063,458.906 " fill="none" id="RealConnection-backto-Socket-1" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="336.662,382.16,338.6588,389.0891,345.8229,389.911,343.8261,382.9818,336.662,382.16" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="42" x="371.5" y="425.0669">socket</text></g><!--reverse link ExchangeFinder to RealConnectionPool--><g id="link_ExchangeFinder_RealConnectionPool"><path codeline="17" d="M183.3713,284.927 C190.8273,329.282 205.087,414.104 212.576,458.656 " fill="none" id="ExchangeFinder-backto-RealConnectionPool" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="181.382,273.093,178.432,279.6731,183.3713,284.927,186.3213,278.3469,181.382,273.093" style="stroke:#181818;stroke-width:1.0;"/></g><!--link RealConnection to RealConnectionPool--><g id="link_RealConnection_RealConnectionPool"><path codeline="18" d="M287.136,382.135 C271.582,404.126 255.2506,427.215 239.7206,449.171 " fill="none" id="RealConnection-to-RealConnectionPool" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="232.791,458.968,239.5215,456.3794,239.7206,449.171,232.9902,451.7596,232.791,458.968" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="24" x="256.2223" y="401.9291">0..n</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="8" x="227.9406" y="447.9718">1</text></g><!--reverse link ExchangeFinder to Address--><g id="link_ExchangeFinder_Address"><path codeline="19" d="M147.3478,281.9433 C130.4058,299.8913 115.303,315.892 98.3727,333.828 " fill="none" id="ExchangeFinder-backto-Address" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="155.585,273.217,148.5576,274.8344,147.3478,281.9433,154.3752,280.3259,155.585,273.217" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link Address to Dns--><g id="link_Address_Dns"><path codeline="20" d="M72.7936,394.0685 C70.4694,416.0595 68.2548,437.012 65.9342,458.968 " fill="none" id="Address-backto-Dns" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="74.0548,382.135,69.4463,387.6814,72.7936,394.0685,77.402,388.5222,74.0548,382.135" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link Dns to DnsSystem--><g id="link_Dns_DnsSystem"><path codeline="21" d="M63.5,525.217 C63.5,543.1649 63.5,549.8918 63.5,567.8279 " fill="none" id="Dns-backto-DnsSystem" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="63.5,507.217,57.5,525.217,69.5,525.217,63.5,507.217" style="stroke:#181818;stroke-width:1.0;"/></g><!--SRC=[VL3H2W8X47ptA-GU0wDwZ0Z2YdegkYyGRol9rb2XWZw-E-qgoteGnzdPTNQuGGJfb-Z1IZXvOobZOxe1eTyulXSA2SzhPnUv5xW3qWBQOUp9pXLMOFCrRYgGQQdvc0kj2MbHe5U7XVSdhXMWZvNeHHcaHRy8cgBNxMBncf0CI7k8QdRO2Wa_l8HNhZ4LZ6wred7M_pVcgHgageyzcjzA8m_WwP1QSOxuhyf52Kd3plXU6wE_SejvCTO94MOQCcCdLMN1EVAu0pT5H-eJzwn1UNKUZdS0]--></g></svg>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/ee27d764.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/8e83ed63.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/8e83ed63.html" class="post-title-link" itemprop="url">okhttp详解系列二：重试重定向拦截器</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2023-08-19 16:26:55" itemprop="dateCreated datePublished" datetime="2023-08-19T16:26:55+08:00">2023-08-19</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-09-21 10:56:11" itemprop="dateModified" datetime="2023-09-21T10:56:11+08:00">2023-09-21</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/okhttp/" itemprop="url" rel="index"><span itemprop="name">okhttp</span></a>
        </span>
    </span>

  
</div>

            <div class="post-description">okhttp详解_RetryAndFollowUpInterceptor</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <ul>
<li><a href="/posts/78efaca4.html" title="okhttp详解系列一：开篇">okhttp详解系列一：开篇</a></li>
<li><a href="/posts/8e83ed63.html" title="okhttp详解系列二：重试重定向拦截器">okhttp详解系列二：重试重定向拦截器</a></li>
<li><a href="/posts/6e2b1d41.html" title="okhttp详解系列三：桥拦截器 BridgeInterceptor">okhttp详解系列三：桥拦截器 BridgeInterceptor</a></li>
<li><a href="/posts/37107c2e.html" title="okhttp详解系列四：缓存拦截器">okhttp详解系列四：缓存拦截器</a></li>
<li><a href="/posts/ee27d764.html" title="okhttp详解系列五：连接拦截器 ConnectInterceptor">okhttp详解系列五：连接拦截器 ConnectInterceptor</a></li>
<li><a href="/posts/73cf04e1.html" title="okhttp详解系列六：服务请求拦截器 CallServerInterceptor">okhttp详解系列六：服务请求拦截器 CallServerInterceptor</a>

</li>
</ul>
<p>重试和重定向拦截器主要负责三件事：1) 出错后判断是否重试；2) 处理重定向；3) 处理用户认证（401和407响应码）；</p>
<p>来看下源码：</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">override</span> <span class="function"><span class="keyword">fun</span> <span class="title">intercept</span><span class="params">(chain: <span class="type">Interceptor</span>.<span class="type">Chain</span>)</span></span>: Response &#123;</span><br><span class="line">  <span class="keyword">val</span> realChain = chain <span class="keyword">as</span> RealInterceptorChain</span><br><span class="line">  <span class="keyword">var</span> request = chain.request</span><br><span class="line">  <span class="keyword">val</span> call = realChain.call</span><br><span class="line">  <span class="keyword">var</span> followUpCount = <span class="number">0</span></span><br><span class="line">  <span class="keyword">var</span> priorResponse: Response? = <span class="literal">null</span></span><br><span class="line">  <span class="keyword">var</span> newExchangeFinder = <span class="literal">true</span></span><br><span class="line">  <span class="keyword">var</span> recoveredFailures = listOf&lt;IOException&gt;()</span><br><span class="line">  <span class="comment">// 1、重试和重定向的场景依然是在while循环中，不会退出该拦截器</span></span><br><span class="line">  <span class="keyword">while</span> (<span class="literal">true</span>) &#123;</span><br><span class="line">    <span class="comment">// 2、根据需要创建 ExchangeFinder</span></span><br><span class="line">    call.enterNetworkInterceptorExchange(request, newExchangeFinder)</span><br><span class="line"></span><br><span class="line">    <span class="keyword">var</span> response: Response</span><br><span class="line">    <span class="keyword">var</span> closeActiveExchange = <span class="literal">true</span></span><br><span class="line">    <span class="keyword">try</span> &#123;</span><br><span class="line">      <span class="keyword">if</span> (call.isCanceled()) &#123;</span><br><span class="line">        <span class="keyword">throw</span> IOException(<span class="string">&quot;Canceled&quot;</span>)</span><br><span class="line">      &#125;</span><br><span class="line"></span><br><span class="line">      <span class="keyword">try</span> &#123;</span><br><span class="line">        <span class="comment">// 3、realChain指向下一个拦截器，发生重试或者重定向后，</span></span><br><span class="line">        <span class="comment">// 会从下一个拦截器开始执行，前面的应用拦截器和此拦截器都不会被执行了</span></span><br><span class="line">        response = realChain.proceed(request)</span><br><span class="line">        newExchangeFinder = <span class="literal">true</span></span><br><span class="line">      &#125; <span class="keyword">catch</span> (e: RouteException) &#123;</span><br><span class="line">        <span class="comment">// The attempt to connect via a route failed. The request will not have been sent.</span></span><br><span class="line">        <span class="keyword">if</span> (!recover(e.lastConnectException, call, request, requestSendStarted = <span class="literal">false</span>)) &#123;</span><br><span class="line">          <span class="keyword">throw</span> e.firstConnectException.withSuppressed(recoveredFailures)</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">          recoveredFailures += e.firstConnectException</span><br><span class="line">        &#125;</span><br><span class="line">        newExchangeFinder = <span class="literal">false</span></span><br><span class="line">        <span class="comment">// 4、错误可以恢复，继续while循环</span></span><br><span class="line">        <span class="keyword">continue</span></span><br><span class="line">      &#125; <span class="keyword">catch</span> (e: IOException) &#123;</span><br><span class="line">        <span class="comment">// An attempt to communicate with a server failed. The request may have been sent.</span></span><br><span class="line">        <span class="keyword">if</span> (!recover(e, call, request, requestSendStarted = e !<span class="keyword">is</span> ConnectionShutdownException)) &#123;</span><br><span class="line">          <span class="keyword">throw</span> e.withSuppressed(recoveredFailures)</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">          recoveredFailures += e</span><br><span class="line">        &#125;</span><br><span class="line">        newExchangeFinder = <span class="literal">false</span></span><br><span class="line">        <span class="comment">// 5、错误可以恢复，继续while循环</span></span><br><span class="line">        <span class="keyword">continue</span></span><br><span class="line">      &#125;</span><br><span class="line"></span><br><span class="line">      ......</span><br><span class="line"></span><br><span class="line">      <span class="keyword">val</span> exchange = call.interceptorScopedExchange</span><br><span class="line">      <span class="comment">// 6、followUpRequest是判断是否重试的主要逻辑，包括重定向、超时重试、用户认证等场景</span></span><br><span class="line">      <span class="keyword">val</span> followUp = followUpRequest(response, exchange)</span><br><span class="line"></span><br><span class="line">      <span class="keyword">if</span> (followUp == <span class="literal">null</span>) &#123;</span><br><span class="line">        <span class="keyword">if</span> (exchange != <span class="literal">null</span> &amp;&amp; exchange.isDuplex) &#123;</span><br><span class="line">          call.timeoutEarlyExit()</span><br><span class="line">        &#125;</span><br><span class="line">        closeActiveExchange = <span class="literal">false</span></span><br><span class="line">        <span class="keyword">return</span> response</span><br><span class="line">      &#125;</span><br><span class="line"></span><br><span class="line">      <span class="keyword">val</span> followUpBody = followUp.body</span><br><span class="line">      <span class="keyword">if</span> (followUpBody != <span class="literal">null</span> &amp;&amp; followUpBody.isOneShot()) &#123;</span><br><span class="line">        closeActiveExchange = <span class="literal">false</span></span><br><span class="line">        <span class="keyword">return</span> response</span><br><span class="line">      &#125;</span><br><span class="line"></span><br><span class="line">      response.body?.closeQuietly()</span><br><span class="line"></span><br><span class="line">      <span class="keyword">if</span> (++followUpCount &gt; MAX_FOLLOW_UPS) &#123;</span><br><span class="line">        <span class="keyword">throw</span> ProtocolException(<span class="string">&quot;Too many follow-up requests: <span class="variable">$followUpCount</span>&quot;</span>)</span><br><span class="line">      &#125;</span><br><span class="line"></span><br><span class="line">      request = followUp</span><br><span class="line">      priorResponse = response</span><br><span class="line">    &#125; <span class="keyword">finally</span> &#123;</span><br><span class="line">      call.exitNetworkInterceptorExchange(closeActiveExchange)</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h2 id="应用拦截器只会被执行一次的原因"><a href="#应用拦截器只会被执行一次的原因" class="headerlink" title="应用拦截器只会被执行一次的原因"></a>应用拦截器只会被执行一次的原因</h2><p>我们都知道okhttp支持两种类型的用户层拦截器：应用拦截器(Application Interceptors)和网络拦截器(Network Interceptors)。应用拦截器每次发起请求都会被保证执行一次，即使发生了重试和重定向也是被执行一次。而网络拦截器在重试和重定向的场景都会被执行多次，而且缓存的场景可能不会被执行。这种差异是什么原因导致的呢？</p>
<p>RetryAndFollowUpInterceptor拦截器使用了一个while循环，当需要重试或者重定向时，不会退出循环，继续执行<code>chain.proceed()</code>，这个chain就是RealInterceptorChain。在分析RealInterceptorChain的proceed()方法时，我们知道每次执行下一个拦截器时，都会把RealInterceptorChain拷贝一份，chain的index就指向下一个拦截器。所以重试和重定向的情况都会从下一个拦截器开始，而用户注册的程序拦截器在RetryAndFollowUpInterceptor前面，这就是即使发生了重试和重定向程序拦截器也会只被执行一次的根本原因。而网络拦截器排在RetryAndFollowUpInterceptor后面，所以会被执行多次。</p>
<h2 id="参考文章"><a href="#参考文章" class="headerlink" title="参考文章"></a>参考文章</h2><ol>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Authentication">HTTP 身份验证</a></li>
</ol>

          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/8e83ed63.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/6e2b1d41.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/6e2b1d41.html" class="post-title-link" itemprop="url">okhttp详解系列三：桥拦截器 BridgeInterceptor</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2023-08-19 15:08:00" itemprop="dateCreated datePublished" datetime="2023-08-19T15:08:00+08:00">2023-08-19</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-09-21 10:47:28" itemprop="dateModified" datetime="2023-09-21T10:47:28+08:00">2023-09-21</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/okhttp/" itemprop="url" rel="index"><span itemprop="name">okhttp</span></a>
        </span>
    </span>

  
</div>

            <div class="post-description">桥拦截器主要用于用户和网络数据之间的转换</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <ul>
<li><a href="/posts/78efaca4.html" title="okhttp详解系列一：开篇">okhttp详解系列一：开篇</a></li>
<li><a href="/posts/8e83ed63.html" title="okhttp详解系列二：重试重定向拦截器">okhttp详解系列二：重试重定向拦截器</a></li>
<li><a href="/posts/6e2b1d41.html" title="okhttp详解系列三：桥拦截器 BridgeInterceptor">okhttp详解系列三：桥拦截器 BridgeInterceptor</a></li>
<li><a href="/posts/37107c2e.html" title="okhttp详解系列四：缓存拦截器">okhttp详解系列四：缓存拦截器</a></li>
<li><a href="/posts/ee27d764.html" title="okhttp详解系列五：连接拦截器 ConnectInterceptor">okhttp详解系列五：连接拦截器 ConnectInterceptor</a></li>
<li><a href="/posts/73cf04e1.html" title="okhttp详解系列六：服务请求拦截器 CallServerInterceptor">okhttp详解系列六：服务请求拦截器 CallServerInterceptor</a>

</li>
</ul>
<p>BridgeInterceptor拦截器简要描述一下就是做了如下三件事：</p>
<ol>
<li>首先会把用户的Request进行进一步的处理（处理request header），转换成真正请求网络的Request；</li>
<li>然后继续调用其他拦截器进行网络请求；</li>
<li>最后收到响应结果后保存cookie，并解压缩gzip，最终转换为用户的Response。</li>
</ol>
<h2 id="BridgeInterceptor处理时序"><a href="#BridgeInterceptor处理时序" class="headerlink" title="BridgeInterceptor处理时序"></a>BridgeInterceptor处理时序</h2><?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentstyletype="text/css" height="642px" preserveAspectRatio="none" style="width:948px;height:642px;background:#FFFFFF;" version="1.1" viewBox="0 0 948 642" width="948px" zoomAndPan="magnify"><defs/><g><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="116.5" x2="116.5" y1="36.2969" y2="606.9844"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="436.5" x2="436.5" y1="36.2969" y2="606.9844"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="607" x2="607" y1="150.3438" y2="606.9844"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="722" x2="722" y1="36.2969" y2="606.9844"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="857" x2="857" y1="36.2969" y2="606.9844"/><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="145" x="44.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="131" x="51.5" y="24.9951">BridgeInterceptor</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="145" x="44.5" y="605.9844"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="131" x="51.5" y="625.9795">BridgeInterceptor</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="73" x="400.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="59" x="407.5" y="24.9951">Request</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="73" x="400.5" y="605.9844"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="59" x="407.5" y="625.9795">Request</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="128" x="543" y="605.9844"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="114" x="550" y="625.9795">Request.Builder</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="82" x="681" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="68" x="688" y="24.9951">CookieJar</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="82" x="681" y="605.9844"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="68" x="688" y="625.9795">CookieJar</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="169" x="773" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="155" x="780" y="24.9951">RealInterceptorChain</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="169" x="773" y="605.9844"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="155" x="780" y="625.9795">RealInterceptorChain</text><ellipse cx="7.5" cy="66.6797" fill="none" rx="4" ry="4" style="stroke:#181818;stroke-width:1.5;"/><polygon fill="#181818" points="105,63.4297,115,67.4297,105,71.4297,109,67.4297" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="12" x2="111" y1="67.4297" y2="67.4297"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="57" x="15" y="62.3638">intercept</text><polygon fill="#181818" points="425,107.6953,435,111.6953,425,115.6953,429,111.6953" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="117" x2="431" y1="111.6953" y2="111.6953"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="80" x="124" y="91.4966">newBuilder()</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="296" x="124" y="106.6294">&#22522;&#20110;&#29992;&#25143;&#20256;&#20837;&#30340;Request&#29983;&#25104;&#26032;&#30340;Request.Builder</text><polygon fill="#181818" points="531,121.6953,541,125.6953,531,129.6953,535,125.6953" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="437" x2="537" y1="125.6953" y2="125.6953"/><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="128" x="543" y="119.6953"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="114" x="550" y="139.6904">Request.Builder</text><polygon fill="#181818" points="595,193.2578,605,197.2578,595,201.2578,599,197.2578" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="117" x2="601" y1="197.2578" y2="197.2578"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="262" x="124" y="177.0591">&#22914;&#26524;body&#19981;&#20026;null&#65292;&#21017;&#26681;&#25454;&#38656;&#35201;&#28155;&#21152;&#35831;&#27714;&#22836;&#65306;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="331" x="124" y="192.1919">Content-Type&#12289;Content-Length&#12289;Transfer-Encoding</text><polygon fill="#181818" points="595,222.3906,605,226.3906,595,230.3906,599,226.3906" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="117" x2="601" y1="226.3906" y2="226.3906"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="146" x="124" y="221.3247">&#22914;&#26524;Host&#19981;&#23384;&#22312;&#65292;&#21017;&#28155;&#21152;</text><polygon fill="#181818" points="595,251.5234,605,255.5234,595,259.5234,599,255.5234" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="117" x2="601" y1="255.5234" y2="255.5234"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="300" x="124" y="250.4575">&#22914;&#26524;Connection&#65292;&#21017;&#28155;&#21152;Connection=Keep-Alive</text><polygon fill="#181818" points="595,280.6563,605,284.6563,595,288.6563,599,284.6563" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="117" x2="601" y1="284.6563" y2="284.6563"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="369" x="124" y="279.5903">&#22914;&#26524;&#29992;&#25143;&#27809;&#26377;&#25351;&#23450;Accept-Encoding&#21644;Range&#22836;&#65292;&#21017;&#35774;&#32622;&#20026;gzip</text><polygon fill="#181818" points="710,309.7891,720,313.7891,710,317.7891,714,313.7891" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="117" x2="716" y1="313.7891" y2="313.7891"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="186" x="124" y="308.7231">loadForRequest(): &#21152;&#36733;cookie</text><polygon fill="#181818" points="595,338.9219,605,342.9219,595,346.9219,599,342.9219" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="117" x2="601" y1="342.9219" y2="342.9219"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="69" x="124" y="337.856">&#28155;&#21152;Cookie</text><polygon fill="#181818" points="595,368.0547,605,372.0547,595,376.0547,599,372.0547" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="117" x2="601" y1="372.0547" y2="372.0547"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="98" x="124" y="366.9888">&#28155;&#21152;User-Agent</text><polygon fill="#181818" points="595,397.1875,605,401.1875,595,405.1875,599,401.1875" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="117" x2="601" y1="401.1875" y2="401.1875"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="40" x="124" y="396.1216">build()</text><polygon fill="#181818" points="448,426.3203,438,430.3203,448,434.3203,444,430.3203" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="442" x2="606" y1="430.3203" y2="430.3203"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="146" x="454" y="425.2544">new() &#29983;&#25104;&#26032;&#30340;Request</text><polygon fill="#181818" points="845.5,455.4531,855.5,459.4531,845.5,463.4531,849.5,459.4531" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="117" x2="851.5" y1="459.4531" y2="459.4531"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="275" x="124" y="454.3872">proceed(Request) &#32487;&#32493;&#20854;&#20182;&#25318;&#25130;&#22120;&#30340;&#22788;&#29702;&#27969;&#31243;</text><polygon fill="#181818" points="128,484.5859,118,488.5859,128,492.5859,124,488.5859" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="122" x2="856.5" y1="488.5859" y2="488.5859"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="117" x="134" y="483.52">&#20854;&#20182;&#25318;&#25130;&#22120;&#22788;&#29702;&#23436;&#25104;</text><polygon fill="#181818" points="710,513.7188,720,517.7188,710,521.7188,714,517.7188" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="117" x2="716" y1="517.7188" y2="517.7188"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="365" x="124" y="512.6528">receiveHeaders(): &#20445;&#23384;cookie&#65292;header&#20013;&#30340;Set-Cookie&#23383;&#27573;</text><line style="stroke:#181818;stroke-width:1.0;" x1="117" x2="159" y1="546.8516" y2="546.8516"/><line style="stroke:#181818;stroke-width:1.0;" x1="159" x2="159" y1="546.8516" y2="559.8516"/><line style="stroke:#181818;stroke-width:1.0;" x1="118" x2="159" y1="559.8516" y2="559.8516"/><polygon fill="#181818" points="128,555.8516,118,559.8516,128,563.8516,124,559.8516" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="247" x="124" y="541.7856">&#22914;&#26524;&#21709;&#24212;&#20869;&#23481;&#26159;gzip&#26684;&#24335;&#65292;&#21017;&#36827;&#34892;&#35299;&#21387;&#22788;&#29702;</text><polygon fill="#181818" points="11,584.9844,1,588.9844,11,592.9844,7,588.9844" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="5" x2="116" y1="588.9844" y2="588.9844"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="93" x="17" y="583.9185">&#36820;&#22238; Response</text><!--SRC=[bLJBRjD05DtxAxnCAfaFY00fZK3biIfbrMvS- -9OM3Dcx83AggcQ4aXIAeXAcuOs5IMDaE82eYJDWtmCdh5PzHUOn0w9sW3DpdCVvvnxxv4NiNHJd2Mwgi4TP0DHmBGnYOdwy25SIegyOnwUfC2oOoA2PxCftL21HA9BY1wqtDQcLwonRCFjL6ZcerTQ3skzuW7BRh7jpwFGjR1L2DzZoCEKE3FpJmN3kfX8gsjilxoCrHMtMN2RBPGoZFDEdcPtMUMC5PnVvLM_ccQDDdrLyKyQxCiQFVfstYajeGJcqCYM5bPC-BcQ7Zxl0zBi90yi41bPZu18jv22LHrfKocQmvRD5T7w3YtNGa434LEXS54855l7Q1nY5Brn3y2KueR-5AR23Mx5lXwoyakMVq6TKbpfD_sPbRx9pyj8Wy6o-io-yyFhEdp1sdFTdCoLmFYn3dTbpc9WMRsDISWUYN9UllvkLncKN57gSDYfMnvQ_6fnZL_pYctB_Oz8LBZemb6jEF1y92fEyBFmDnRP60ibahAEOg99i0AWHi9U3jW-zjfrcldkjhTPhigod-XkZOFJetLlQuETfhrQJY1WfmWIBrG59TJ9SqN_FGa11RXDva3cardzaxYzzzoUmKduaPE3ZDkiS_87O4j1Bws_OyxfPFG9Fv30NlHjWRQAT2D3dJEsSzAt3AjqQETrwANUdd-Ozuy_qCrSC8EmU5sw3CUNxlUAT6-Vxz8oCRBWDm00]--></g></svg>

<p>从上述流程可以看出BridgeInterceptor拦截器的处理逻辑比较简单。</p>

          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/6e2b1d41.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/37107c2e.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/37107c2e.html" class="post-title-link" itemprop="url">okhttp详解系列四：缓存拦截器</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2023-08-17 15:12:30" itemprop="dateCreated datePublished" datetime="2023-08-17T15:12:30+08:00">2023-08-17</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-09-21 10:47:23" itemprop="dateModified" datetime="2023-09-21T10:47:23+08:00">2023-09-21</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/okhttp/" itemprop="url" rel="index"><span itemprop="name">okhttp</span></a>
        </span>
    </span>

  
</div>

            <div class="post-description">本文详细介绍了缓存拦截器的处理逻辑</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <ul>
<li><a href="/posts/78efaca4.html" title="okhttp详解系列一：开篇">okhttp详解系列一：开篇</a></li>
<li><a href="/posts/8e83ed63.html" title="okhttp详解系列二：重试重定向拦截器">okhttp详解系列二：重试重定向拦截器</a></li>
<li><a href="/posts/6e2b1d41.html" title="okhttp详解系列三：桥拦截器 BridgeInterceptor">okhttp详解系列三：桥拦截器 BridgeInterceptor</a></li>
<li><a href="/posts/37107c2e.html" title="okhttp详解系列四：缓存拦截器">okhttp详解系列四：缓存拦截器</a></li>
<li><a href="/posts/ee27d764.html" title="okhttp详解系列五：连接拦截器 ConnectInterceptor">okhttp详解系列五：连接拦截器 ConnectInterceptor</a></li>
<li><a href="/posts/73cf04e1.html" title="okhttp详解系列六：服务请求拦截器 CallServerInterceptor">okhttp详解系列六：服务请求拦截器 CallServerInterceptor</a>

</li>
</ul>
<h2 id="缓存使用方法"><a href="#缓存使用方法" class="headerlink" title="缓存使用方法"></a>缓存使用方法</h2><figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">private</span> <span class="keyword">val</span> client: OkHttpClient = OkHttpClient.Builder()</span><br><span class="line">    .cache(Cache(</span><br><span class="line">        directory = File(<span class="string">&quot;/dir/http_cache&quot;</span>),</span><br><span class="line">        maxSize = <span class="number">5L</span> * <span class="number">1024L</span> * <span class="number">1024L</span> <span class="comment">// 5MiB</span></span><br><span class="line">    ))</span><br><span class="line">    .build()</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p>缓存机制只实现了get请求的缓存，不支持其他的请求类型，比如POST。下面的官方的说明：</p>
<blockquote>
<p>Don’t cache non-GET responses. We’re technically allowed to cache HEAD requests and some POST requests, but the complexity of doing so is high and the benefit is low.</p>
</blockquote>
<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentstyletype="text/css" height="311px" preserveAspectRatio="none" style="width:499px;height:311px;background:#FFFFFF;" version="1.1" viewBox="0 0 499 311" width="499px" zoomAndPan="magnify"><defs/><g><!--class Cache--><g id="elem_Cache"><rect codeline="1" fill="#F1F1F1" height="80.5938" id="Cache" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="311" x="7" y="115"/><ellipse cx="136.25" cy="131" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M138.5938,126.6719 C137.6563,126.2344 137.0625,126.0938 136.1875,126.0938 C133.5625,126.0938 131.5625,128.1719 131.5625,130.8906 L131.5625,132.0156 C131.5625,134.5938 133.6719,136.4844 136.5625,136.4844 C137.7813,136.4844 138.9375,136.1875 139.6875,135.6406 C140.2656,135.2344 140.5938,134.7813 140.5938,134.3906 C140.5938,133.9375 140.2031,133.5469 139.7344,133.5469 C139.5156,133.5469 139.3125,133.625 139.125,133.8125 C138.6719,134.2969 138.6719,134.2969 138.4844,134.3906 C138.0625,134.6563 137.375,134.7813 136.6094,134.7813 C134.5625,134.7813 133.2656,133.6875 133.2656,131.9844 L133.2656,130.8906 C133.2656,129.1094 134.5156,127.7969 136.25,127.7969 C136.8281,127.7969 137.4375,127.9531 137.9063,128.2031 C138.3906,128.4844 138.5625,128.7031 138.6563,129.1094 C138.7188,129.5156 138.75,129.6406 138.8906,129.7656 C139.0313,129.9063 139.2656,130.0156 139.4844,130.0156 C139.75,130.0156 140.0156,129.875 140.1875,129.6563 C140.2969,129.5 140.3281,129.3125 140.3281,128.8906 L140.3281,127.4688 C140.3281,127.0313 140.3125,126.9063 140.2188,126.75 C140.0625,126.4844 139.7813,126.3438 139.4844,126.3438 C139.1875,126.3438 138.9844,126.4375 138.7656,126.75 L138.5938,126.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="44" x="156.75" y="135.8467">Cache</text><line style="stroke:#181818;stroke-width:0.5;" x1="8" x2="317" y1="147" y2="147"/><line style="stroke:#181818;stroke-width:0.5;" x1="8" x2="317" y1="155" y2="155"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="244" x="13" y="171.9951">get(request: Request): Response?</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="299" x="13" y="188.292">put(response: Response): CacheRequest?</text></g><!--class CacheInterceptor--><g id="elem_CacheInterceptor"><rect fill="#F1F1F1" height="48" id="CacheInterceptor" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="160" x="212.5" y="7"/><ellipse cx="227.5" cy="23" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M229.8438,18.6719 C228.9063,18.2344 228.3125,18.0938 227.4375,18.0938 C224.8125,18.0938 222.8125,20.1719 222.8125,22.8906 L222.8125,24.0156 C222.8125,26.5938 224.9219,28.4844 227.8125,28.4844 C229.0313,28.4844 230.1875,28.1875 230.9375,27.6406 C231.5156,27.2344 231.8438,26.7813 231.8438,26.3906 C231.8438,25.9375 231.4531,25.5469 230.9844,25.5469 C230.7656,25.5469 230.5625,25.625 230.375,25.8125 C229.9219,26.2969 229.9219,26.2969 229.7344,26.3906 C229.3125,26.6563 228.625,26.7813 227.8594,26.7813 C225.8125,26.7813 224.5156,25.6875 224.5156,23.9844 L224.5156,22.8906 C224.5156,21.1094 225.7656,19.7969 227.5,19.7969 C228.0781,19.7969 228.6875,19.9531 229.1563,20.2031 C229.6406,20.4844 229.8125,20.7031 229.9063,21.1094 C229.9688,21.5156 230,21.6406 230.1406,21.7656 C230.2813,21.9063 230.5156,22.0156 230.7344,22.0156 C231,22.0156 231.2656,21.875 231.4375,21.6563 C231.5469,21.5 231.5781,21.3125 231.5781,20.8906 L231.5781,19.4688 C231.5781,19.0313 231.5625,18.9063 231.4688,18.75 C231.3125,18.4844 231.0313,18.3438 230.7344,18.3438 C230.4375,18.3438 230.2344,18.4375 230.0156,18.75 L229.8438,18.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="128" x="241.5" y="27.8467">CacheInterceptor</text><line style="stroke:#181818;stroke-width:0.5;" x1="213.5" x2="371.5" y1="39" y2="39"/><line style="stroke:#181818;stroke-width:0.5;" x1="213.5" x2="371.5" y1="47" y2="47"/></g><!--class DiskLruCache--><g id="elem_DiskLruCache"><rect fill="#F1F1F1" height="48" id="DiskLruCache" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="129" x="98" y="256"/><ellipse cx="113" cy="272" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M115.3438,267.6719 C114.4063,267.2344 113.8125,267.0938 112.9375,267.0938 C110.3125,267.0938 108.3125,269.1719 108.3125,271.8906 L108.3125,273.0156 C108.3125,275.5938 110.4219,277.4844 113.3125,277.4844 C114.5313,277.4844 115.6875,277.1875 116.4375,276.6406 C117.0156,276.2344 117.3438,275.7813 117.3438,275.3906 C117.3438,274.9375 116.9531,274.5469 116.4844,274.5469 C116.2656,274.5469 116.0625,274.625 115.875,274.8125 C115.4219,275.2969 115.4219,275.2969 115.2344,275.3906 C114.8125,275.6563 114.125,275.7813 113.3594,275.7813 C111.3125,275.7813 110.0156,274.6875 110.0156,272.9844 L110.0156,271.8906 C110.0156,270.1094 111.2656,268.7969 113,268.7969 C113.5781,268.7969 114.1875,268.9531 114.6563,269.2031 C115.1406,269.4844 115.3125,269.7031 115.4063,270.1094 C115.4688,270.5156 115.5,270.6406 115.6406,270.7656 C115.7813,270.9063 116.0156,271.0156 116.2344,271.0156 C116.5,271.0156 116.7656,270.875 116.9375,270.6563 C117.0469,270.5 117.0781,270.3125 117.0781,269.8906 L117.0781,268.4688 C117.0781,268.0313 117.0625,267.9063 116.9688,267.75 C116.8125,267.4844 116.5313,267.3438 116.2344,267.3438 C115.9375,267.3438 115.7344,267.4375 115.5156,267.75 L115.3438,267.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="97" x="127" y="276.8467">DiskLruCache</text><line style="stroke:#181818;stroke-width:0.5;" x1="99" x2="226" y1="288" y2="288"/><line style="stroke:#181818;stroke-width:0.5;" x1="99" x2="226" y1="296" y2="296"/></g><!--class CacheStrategy--><g id="elem_CacheStrategy"><rect fill="#F1F1F1" height="48" id="CacheStrategy" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="139" x="353" y="131.5"/><ellipse cx="368" cy="147.5" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M370.3438,143.1719 C369.4063,142.7344 368.8125,142.5938 367.9375,142.5938 C365.3125,142.5938 363.3125,144.6719 363.3125,147.3906 L363.3125,148.5156 C363.3125,151.0938 365.4219,152.9844 368.3125,152.9844 C369.5313,152.9844 370.6875,152.6875 371.4375,152.1406 C372.0156,151.7344 372.3438,151.2813 372.3438,150.8906 C372.3438,150.4375 371.9531,150.0469 371.4844,150.0469 C371.2656,150.0469 371.0625,150.125 370.875,150.3125 C370.4219,150.7969 370.4219,150.7969 370.2344,150.8906 C369.8125,151.1563 369.125,151.2813 368.3594,151.2813 C366.3125,151.2813 365.0156,150.1875 365.0156,148.4844 L365.0156,147.3906 C365.0156,145.6094 366.2656,144.2969 368,144.2969 C368.5781,144.2969 369.1875,144.4531 369.6563,144.7031 C370.1406,144.9844 370.3125,145.2031 370.4063,145.6094 C370.4688,146.0156 370.5,146.1406 370.6406,146.2656 C370.7813,146.4063 371.0156,146.5156 371.2344,146.5156 C371.5,146.5156 371.7656,146.375 371.9375,146.1563 C372.0469,146 372.0781,145.8125 372.0781,145.3906 L372.0781,143.9688 C372.0781,143.5313 372.0625,143.4063 371.9688,143.25 C371.8125,142.9844 371.5313,142.8438 371.2344,142.8438 C370.9375,142.8438 370.7344,142.9375 370.5156,143.25 L370.3438,143.1719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="107" x="382" y="152.3467">CacheStrategy</text><line style="stroke:#181818;stroke-width:0.5;" x1="354" x2="491" y1="163.5" y2="163.5"/><line style="stroke:#181818;stroke-width:0.5;" x1="354" x2="491" y1="171.5" y2="171.5"/></g><!--class CacheControl--><g id="elem_CacheControl"><rect fill="#F1F1F1" height="48" id="CacheControl" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="130" x="357.5" y="256"/><ellipse cx="372.5" cy="272" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M374.8438,267.6719 C373.9063,267.2344 373.3125,267.0938 372.4375,267.0938 C369.8125,267.0938 367.8125,269.1719 367.8125,271.8906 L367.8125,273.0156 C367.8125,275.5938 369.9219,277.4844 372.8125,277.4844 C374.0313,277.4844 375.1875,277.1875 375.9375,276.6406 C376.5156,276.2344 376.8438,275.7813 376.8438,275.3906 C376.8438,274.9375 376.4531,274.5469 375.9844,274.5469 C375.7656,274.5469 375.5625,274.625 375.375,274.8125 C374.9219,275.2969 374.9219,275.2969 374.7344,275.3906 C374.3125,275.6563 373.625,275.7813 372.8594,275.7813 C370.8125,275.7813 369.5156,274.6875 369.5156,272.9844 L369.5156,271.8906 C369.5156,270.1094 370.7656,268.7969 372.5,268.7969 C373.0781,268.7969 373.6875,268.9531 374.1563,269.2031 C374.6406,269.4844 374.8125,269.7031 374.9063,270.1094 C374.9688,270.5156 375,270.6406 375.1406,270.7656 C375.2813,270.9063 375.5156,271.0156 375.7344,271.0156 C376,271.0156 376.2656,270.875 376.4375,270.6563 C376.5469,270.5 376.5781,270.3125 376.5781,269.8906 L376.5781,268.4688 C376.5781,268.0313 376.5625,267.9063 376.4688,267.75 C376.3125,267.4844 376.0313,267.3438 375.7344,267.3438 C375.4375,267.3438 375.2344,267.4375 375.0156,267.75 L374.8438,267.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="98" x="386.5" y="276.8467">CacheControl</text><line style="stroke:#181818;stroke-width:0.5;" x1="358.5" x2="486.5" y1="288" y2="288"/><line style="stroke:#181818;stroke-width:0.5;" x1="358.5" x2="486.5" y1="296" y2="296"/></g><!--reverse link CacheInterceptor to Cache--><g id="link_CacheInterceptor_Cache"><path codeline="5" d="M259.3146,63.2706 C241.4416,80.1126 225.493,95.142 204.49,114.933 " fill="none" id="CacheInterceptor-backto-Cache" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="268.048,55.041,260.9381,56.2447,259.3146,63.2706,266.4245,62.067,268.048,55.041" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link Cache to DiskLruCache--><g id="link_Cache_DiskLruCache"><path codeline="6" d="M162.5,208.272 C162.5,227.9732 162.5,239.0687 162.5,255.8428 " fill="none" id="Cache-backto-DiskLruCache" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="162.5,196.272,158.5,202.272,162.5,208.272,166.5,202.272,162.5,196.272" style="stroke:#181818;stroke-width:1.0;"/></g><!--link CacheInterceptor to CacheStrategy--><g id="link_CacheInterceptor_CacheStrategy"><path codeline="7" d="M316.952,55.041 C340.047,76.804 370.1452,105.1662 393.3492,127.0312 " fill="none" id="CacheInterceptor-to-CacheStrategy" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="397.716,131.146,393.909,122.0627,394.077,127.717,388.4227,127.885,397.716,131.146" style="stroke:#181818;stroke-width:1.0;"/></g><!--link CacheStrategy to CacheControl--><g id="link_CacheStrategy_CacheControl"><path codeline="8" d="M422.5,179.541 C422.5,201.304 422.5,227.781 422.5,249.6455 " fill="none" id="CacheStrategy-to-CacheControl" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="422.5,255.6455,426.5,246.6455,422.5,250.6455,418.5,246.6455,422.5,255.6455" style="stroke:#181818;stroke-width:1.0;"/></g><!--SRC=[Iyv9B2vMS4vCpaXLgEPI08Bqr1ADejJ2qjJY4Yk580X34yGgBiZFAqwr1oigA0KfWeWWv83Am2P1TTbprNA1-Pvv9Qb5oQa59Vb52bgwkX1542amtoMpEDkdg1H965c7hguTH4TmIL5YIMfw9HSA3o7ld9zNKfIV0m00]--></g></svg>

<p><strong>Cache-Control</strong>请求头是控制缓存策略的关键，server、client端都可以进行设置。<strong>Cache-Control</strong>决定了哪些response可以被缓存，以及缓存的response是否满足当前的request。协议定义可以参考<a target="_blank" rel="noopener external nofollow noreferrer" href="https://tools.ietf.org/html/rfc7234#section-5.2">RFC 7234, 5.2</a>。</p>
<h2 id="缓存拦截器流程"><a href="#缓存拦截器流程" class="headerlink" title="缓存拦截器流程"></a>缓存拦截器流程</h2><p>缓存拦截器的处理流程如下：</p>
<ol>
<li>首先通过url的md5值去读取本地可用缓存（后面会校验缓存是否可用）；</li>
<li>计算得到CacheStrategy，实际上就是计算得到<strong>networkRequest</strong>和<strong>cacheResponse</strong>，如果两者都为null，就直接报504错误；如果networkRequest是null，表示直接使用缓存。</li>
</ol>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/37107c2e.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/78efaca4.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/78efaca4.html" class="post-title-link" itemprop="url">okhttp详解系列一：开篇</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2023-08-17 15:06:50" itemprop="dateCreated datePublished" datetime="2023-08-17T15:06:50+08:00">2023-08-17</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2024-01-04 19:26:29" itemprop="dateModified" datetime="2024-01-04T19:26:29+08:00">2024-01-04</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/okhttp/" itemprop="url" rel="index"><span itemprop="name">okhttp</span></a>
        </span>
    </span>

  
</div>

            <div class="post-description">okhttp源码详细解析，包含整体架构，以及各个拦截器的详解</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <ul>
<li><a href="/posts/78efaca4.html" title="okhttp详解系列一：开篇">okhttp详解系列一：开篇</a></li>
<li><a href="/posts/8e83ed63.html" title="okhttp详解系列二：重试重定向拦截器">okhttp详解系列二：重试重定向拦截器</a></li>
<li><a href="/posts/6e2b1d41.html" title="okhttp详解系列三：桥拦截器 BridgeInterceptor">okhttp详解系列三：桥拦截器 BridgeInterceptor</a></li>
<li><a href="/posts/37107c2e.html" title="okhttp详解系列四：缓存拦截器">okhttp详解系列四：缓存拦截器</a></li>
<li><a href="/posts/ee27d764.html" title="okhttp详解系列五：连接拦截器 ConnectInterceptor">okhttp详解系列五：连接拦截器 ConnectInterceptor</a></li>
<li><a href="/posts/73cf04e1.html" title="okhttp详解系列六：服务请求拦截器 CallServerInterceptor">okhttp详解系列六：服务请求拦截器 CallServerInterceptor</a>

</li>
</ul>
<h2 id="okhttp-整体架构"><a href="#okhttp-整体架构" class="headerlink" title="okhttp 整体架构"></a>okhttp 整体架构</h2><?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentstyletype="text/css" height="435px" preserveAspectRatio="none" style="width:839px;height:435px;background:#FFFFFF;" version="1.1" viewBox="0 0 839 435" width="839px" zoomAndPan="magnify"><defs/><g><!--class RealCall--><g id="elem_RealCall"><rect fill="#F1F1F1" height="48" id="RealCall" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="89" x="407" y="7"/><ellipse cx="422" cy="23" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M424.3438,18.6719 C423.4063,18.2344 422.8125,18.0938 421.9375,18.0938 C419.3125,18.0938 417.3125,20.1719 417.3125,22.8906 L417.3125,24.0156 C417.3125,26.5938 419.4219,28.4844 422.3125,28.4844 C423.5313,28.4844 424.6875,28.1875 425.4375,27.6406 C426.0156,27.2344 426.3438,26.7813 426.3438,26.3906 C426.3438,25.9375 425.9531,25.5469 425.4844,25.5469 C425.2656,25.5469 425.0625,25.625 424.875,25.8125 C424.4219,26.2969 424.4219,26.2969 424.2344,26.3906 C423.8125,26.6563 423.125,26.7813 422.3594,26.7813 C420.3125,26.7813 419.0156,25.6875 419.0156,23.9844 L419.0156,22.8906 C419.0156,21.1094 420.2656,19.7969 422,19.7969 C422.5781,19.7969 423.1875,19.9531 423.6563,20.2031 C424.1406,20.4844 424.3125,20.7031 424.4063,21.1094 C424.4688,21.5156 424.5,21.6406 424.6406,21.7656 C424.7813,21.9063 425.0156,22.0156 425.2344,22.0156 C425.5,22.0156 425.7656,21.875 425.9375,21.6563 C426.0469,21.5 426.0781,21.3125 426.0781,20.8906 L426.0781,19.4688 C426.0781,19.0313 426.0625,18.9063 425.9688,18.75 C425.8125,18.4844 425.5313,18.3438 425.2344,18.3438 C424.9375,18.3438 424.7344,18.4375 424.5156,18.75 L424.3438,18.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="57" x="436" y="27.8467">RealCall</text><line style="stroke:#181818;stroke-width:0.5;" x1="408" x2="495" y1="39" y2="39"/><line style="stroke:#181818;stroke-width:0.5;" x1="408" x2="495" y1="47" y2="47"/></g><!--class OkHttpClient--><g id="elem_OkHttpClient"><rect fill="#F1F1F1" height="48" id="OkHttpClient" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="129" x="531" y="7"/><ellipse cx="546" cy="23" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M548.3438,18.6719 C547.4063,18.2344 546.8125,18.0938 545.9375,18.0938 C543.3125,18.0938 541.3125,20.1719 541.3125,22.8906 L541.3125,24.0156 C541.3125,26.5938 543.4219,28.4844 546.3125,28.4844 C547.5313,28.4844 548.6875,28.1875 549.4375,27.6406 C550.0156,27.2344 550.3438,26.7813 550.3438,26.3906 C550.3438,25.9375 549.9531,25.5469 549.4844,25.5469 C549.2656,25.5469 549.0625,25.625 548.875,25.8125 C548.4219,26.2969 548.4219,26.2969 548.2344,26.3906 C547.8125,26.6563 547.125,26.7813 546.3594,26.7813 C544.3125,26.7813 543.0156,25.6875 543.0156,23.9844 L543.0156,22.8906 C543.0156,21.1094 544.2656,19.7969 546,19.7969 C546.5781,19.7969 547.1875,19.9531 547.6563,20.2031 C548.1406,20.4844 548.3125,20.7031 548.4063,21.1094 C548.4688,21.5156 548.5,21.6406 548.6406,21.7656 C548.7813,21.9063 549.0156,22.0156 549.2344,22.0156 C549.5,22.0156 549.7656,21.875 549.9375,21.6563 C550.0469,21.5 550.0781,21.3125 550.0781,20.8906 L550.0781,19.4688 C550.0781,19.0313 550.0625,18.9063 549.9688,18.75 C549.8125,18.4844 549.5313,18.3438 549.2344,18.3438 C548.9375,18.3438 548.7344,18.4375 548.5156,18.75 L548.3438,18.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="97" x="560" y="27.8467">OkHttpClient</text><line style="stroke:#181818;stroke-width:0.5;" x1="532" x2="659" y1="39" y2="39"/><line style="stroke:#181818;stroke-width:0.5;" x1="532" x2="659" y1="47" y2="47"/></g><!--class RealInterceptorChain--><g id="elem_RealInterceptorChain"><rect codeline="10" fill="#F1F1F1" height="96.8906" id="RealInterceptorChain" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="244" x="329.5" y="115"/><ellipse cx="370.15" cy="131" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M372.4938,126.6719 C371.5563,126.2344 370.9625,126.0938 370.0875,126.0938 C367.4625,126.0938 365.4625,128.1719 365.4625,130.8906 L365.4625,132.0156 C365.4625,134.5938 367.5719,136.4844 370.4625,136.4844 C371.6813,136.4844 372.8375,136.1875 373.5875,135.6406 C374.1656,135.2344 374.4938,134.7813 374.4938,134.3906 C374.4938,133.9375 374.1031,133.5469 373.6344,133.5469 C373.4156,133.5469 373.2125,133.625 373.025,133.8125 C372.5719,134.2969 372.5719,134.2969 372.3844,134.3906 C371.9625,134.6563 371.275,134.7813 370.5094,134.7813 C368.4625,134.7813 367.1656,133.6875 367.1656,131.9844 L367.1656,130.8906 C367.1656,129.1094 368.4156,127.7969 370.15,127.7969 C370.7281,127.7969 371.3375,127.9531 371.8063,128.2031 C372.2906,128.4844 372.4625,128.7031 372.5563,129.1094 C372.6188,129.5156 372.65,129.6406 372.7906,129.7656 C372.9313,129.9063 373.1656,130.0156 373.3844,130.0156 C373.65,130.0156 373.9156,129.875 374.0875,129.6563 C374.1969,129.5 374.2281,129.3125 374.2281,128.8906 L374.2281,127.4688 C374.2281,127.0313 374.2125,126.9063 374.1188,126.75 C373.9625,126.4844 373.6813,126.3438 373.3844,126.3438 C373.0875,126.3438 372.8844,126.4375 372.6656,126.75 L372.4938,126.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="155" x="389.85" y="135.8467">RealInterceptorChain</text><line style="stroke:#181818;stroke-width:0.5;" x1="330.5" x2="572.5" y1="147" y2="147"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="68" x="335.5" y="163.9951">index: Int</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="232" x="335.5" y="180.292">interceptors: List&lt;Interceptor&gt;</text><line style="stroke:#181818;stroke-width:0.5;" x1="330.5" x2="572.5" y1="187.5938" y2="187.5938"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="213" x="335.5" y="204.5889">Response proceed(Request r)</text></g><!--class Interceptor--><g id="elem_Interceptor"><rect codeline="9" fill="#F1F1F1" height="48" id="Interceptor" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="111" x="231" y="272"/><ellipse cx="246" cy="288" fill="#B4A7E5" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M246.9531,284.7813 L248.6719,284.7813 C249.0625,284.7813 249.25,284.75 249.375,284.6719 C249.6406,284.5156 249.7813,284.2344 249.7813,283.9375 C249.7813,283.6719 249.6719,283.4063 249.4375,283.2344 C249.2656,283.125 249.125,283.0938 248.6719,283.0938 L243.5313,283.0938 C243.0938,283.0938 242.9688,283.1094 242.8125,283.2031 C242.5625,283.3594 242.4063,283.6563 242.4063,283.9375 C242.4063,284.2188 242.5469,284.4688 242.7656,284.6406 C242.9219,284.75 243.1094,284.7813 243.5313,284.7813 L245.25,284.7813 L245.25,291.2969 L243.5313,291.2969 C243.0938,291.2969 242.9688,291.3125 242.8125,291.4219 C242.5625,291.5781 242.4063,291.8594 242.4063,292.1563 C242.4063,292.4063 242.5469,292.6719 242.7656,292.8281 C242.9219,292.9531 243.125,293 243.5313,293 L248.6719,293 C249.4219,293 249.7813,292.7188 249.7813,292.1563 C249.7813,291.875 249.6719,291.625 249.4375,291.4531 C249.2656,291.3281 249.125,291.2969 248.6719,291.2969 L246.9531,291.2969 L246.9531,284.7813 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="79" x="260" y="292.8467">Interceptor</text><line style="stroke:#181818;stroke-width:0.5;" x1="232" x2="341" y1="304" y2="304"/><line style="stroke:#181818;stroke-width:0.5;" x1="232" x2="341" y1="312" y2="312"/></g><!--class ExchangeFinder--><g id="elem_ExchangeFinder"><rect fill="#F1F1F1" height="48" id="ExchangeFinder" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="146" x="670.5" y="272"/><ellipse cx="685.5" cy="288" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M687.8438,283.6719 C686.9063,283.2344 686.3125,283.0938 685.4375,283.0938 C682.8125,283.0938 680.8125,285.1719 680.8125,287.8906 L680.8125,289.0156 C680.8125,291.5938 682.9219,293.4844 685.8125,293.4844 C687.0313,293.4844 688.1875,293.1875 688.9375,292.6406 C689.5156,292.2344 689.8438,291.7813 689.8438,291.3906 C689.8438,290.9375 689.4531,290.5469 688.9844,290.5469 C688.7656,290.5469 688.5625,290.625 688.375,290.8125 C687.9219,291.2969 687.9219,291.2969 687.7344,291.3906 C687.3125,291.6563 686.625,291.7813 685.8594,291.7813 C683.8125,291.7813 682.5156,290.6875 682.5156,288.9844 L682.5156,287.8906 C682.5156,286.1094 683.7656,284.7969 685.5,284.7969 C686.0781,284.7969 686.6875,284.9531 687.1563,285.2031 C687.6406,285.4844 687.8125,285.7031 687.9063,286.1094 C687.9688,286.5156 688,286.6406 688.1406,286.7656 C688.2813,286.9063 688.5156,287.0156 688.7344,287.0156 C689,287.0156 689.2656,286.875 689.4375,286.6563 C689.5469,286.5 689.5781,286.3125 689.5781,285.8906 L689.5781,284.4688 C689.5781,284.0313 689.5625,283.9063 689.4688,283.75 C689.3125,283.4844 689.0313,283.3438 688.7344,283.3438 C688.4375,283.3438 688.2344,283.4375 688.0156,283.75 L687.8438,283.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="114" x="699.5" y="292.8467">ExchangeFinder</text><line style="stroke:#181818;stroke-width:0.5;" x1="671.5" x2="815.5" y1="304" y2="304"/><line style="stroke:#181818;stroke-width:0.5;" x1="671.5" x2="815.5" y1="312" y2="312"/></g><!--class RealConnectionPool--><g id="elem_RealConnectionPool"><rect fill="#F1F1F1" height="48" id="RealConnectionPool" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="177" x="655" y="380"/><ellipse cx="670" cy="396" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M672.3438,391.6719 C671.4063,391.2344 670.8125,391.0938 669.9375,391.0938 C667.3125,391.0938 665.3125,393.1719 665.3125,395.8906 L665.3125,397.0156 C665.3125,399.5938 667.4219,401.4844 670.3125,401.4844 C671.5313,401.4844 672.6875,401.1875 673.4375,400.6406 C674.0156,400.2344 674.3438,399.7813 674.3438,399.3906 C674.3438,398.9375 673.9531,398.5469 673.4844,398.5469 C673.2656,398.5469 673.0625,398.625 672.875,398.8125 C672.4219,399.2969 672.4219,399.2969 672.2344,399.3906 C671.8125,399.6563 671.125,399.7813 670.3594,399.7813 C668.3125,399.7813 667.0156,398.6875 667.0156,396.9844 L667.0156,395.8906 C667.0156,394.1094 668.2656,392.7969 670,392.7969 C670.5781,392.7969 671.1875,392.9531 671.6563,393.2031 C672.1406,393.4844 672.3125,393.7031 672.4063,394.1094 C672.4688,394.5156 672.5,394.6406 672.6406,394.7656 C672.7813,394.9063 673.0156,395.0156 673.2344,395.0156 C673.5,395.0156 673.7656,394.875 673.9375,394.6563 C674.0469,394.5 674.0781,394.3125 674.0781,393.8906 L674.0781,392.4688 C674.0781,392.0313 674.0625,391.9063 673.9688,391.75 C673.8125,391.4844 673.5313,391.3438 673.2344,391.3438 C672.9375,391.3438 672.7344,391.4375 672.5156,391.75 L672.3438,391.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="145" x="684" y="400.8467">RealConnectionPool</text><line style="stroke:#181818;stroke-width:0.5;" x1="656" x2="831" y1="412" y2="412"/><line style="stroke:#181818;stroke-width:0.5;" x1="656" x2="831" y1="420" y2="420"/></g><!--class Exchange--><g id="elem_Exchange"><rect fill="#F1F1F1" height="48" id="Exchange" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="101" x="609" y="139.5"/><ellipse cx="624" cy="155.5" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M626.3438,151.1719 C625.4063,150.7344 624.8125,150.5938 623.9375,150.5938 C621.3125,150.5938 619.3125,152.6719 619.3125,155.3906 L619.3125,156.5156 C619.3125,159.0938 621.4219,160.9844 624.3125,160.9844 C625.5313,160.9844 626.6875,160.6875 627.4375,160.1406 C628.0156,159.7344 628.3438,159.2813 628.3438,158.8906 C628.3438,158.4375 627.9531,158.0469 627.4844,158.0469 C627.2656,158.0469 627.0625,158.125 626.875,158.3125 C626.4219,158.7969 626.4219,158.7969 626.2344,158.8906 C625.8125,159.1563 625.125,159.2813 624.3594,159.2813 C622.3125,159.2813 621.0156,158.1875 621.0156,156.4844 L621.0156,155.3906 C621.0156,153.6094 622.2656,152.2969 624,152.2969 C624.5781,152.2969 625.1875,152.4531 625.6563,152.7031 C626.1406,152.9844 626.3125,153.2031 626.4063,153.6094 C626.4688,154.0156 626.5,154.1406 626.6406,154.2656 C626.7813,154.4063 627.0156,154.5156 627.2344,154.5156 C627.5,154.5156 627.7656,154.375 627.9375,154.1563 C628.0469,154 628.0781,153.8125 628.0781,153.3906 L628.0781,151.9688 C628.0781,151.5313 628.0625,151.4063 627.9688,151.25 C627.8125,150.9844 627.5313,150.8438 627.2344,150.8438 C626.9375,150.8438 626.7344,150.9375 626.5156,151.25 L626.3438,151.1719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="69" x="638" y="160.3467">Exchange</text><line style="stroke:#181818;stroke-width:0.5;" x1="610" x2="709" y1="171.5" y2="171.5"/><line style="stroke:#181818;stroke-width:0.5;" x1="610" x2="709" y1="179.5" y2="179.5"/></g><!--class RetryAndFollowUpInterceptor--><g id="elem_RetryAndFollowUpInterceptor"><rect fill="#F1F1F1" height="48" id="RetryAndFollowUpInterceptor" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="248" x="377.5" y="272"/><ellipse cx="392.5" cy="288" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M394.8438,283.6719 C393.9063,283.2344 393.3125,283.0938 392.4375,283.0938 C389.8125,283.0938 387.8125,285.1719 387.8125,287.8906 L387.8125,289.0156 C387.8125,291.5938 389.9219,293.4844 392.8125,293.4844 C394.0313,293.4844 395.1875,293.1875 395.9375,292.6406 C396.5156,292.2344 396.8438,291.7813 396.8438,291.3906 C396.8438,290.9375 396.4531,290.5469 395.9844,290.5469 C395.7656,290.5469 395.5625,290.625 395.375,290.8125 C394.9219,291.2969 394.9219,291.2969 394.7344,291.3906 C394.3125,291.6563 393.625,291.7813 392.8594,291.7813 C390.8125,291.7813 389.5156,290.6875 389.5156,288.9844 L389.5156,287.8906 C389.5156,286.1094 390.7656,284.7969 392.5,284.7969 C393.0781,284.7969 393.6875,284.9531 394.1563,285.2031 C394.6406,285.4844 394.8125,285.7031 394.9063,286.1094 C394.9688,286.5156 395,286.6406 395.1406,286.7656 C395.2813,286.9063 395.5156,287.0156 395.7344,287.0156 C396,287.0156 396.2656,286.875 396.4375,286.6563 C396.5469,286.5 396.5781,286.3125 396.5781,285.8906 L396.5781,284.4688 C396.5781,284.0313 396.5625,283.9063 396.4688,283.75 C396.3125,283.4844 396.0313,283.3438 395.7344,283.3438 C395.4375,283.3438 395.2344,283.4375 395.0156,283.75 L394.8438,283.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="216" x="406.5" y="292.8467">RetryAndFollowUpInterceptor</text><line style="stroke:#181818;stroke-width:0.5;" x1="378.5" x2="624.5" y1="304" y2="304"/><line style="stroke:#181818;stroke-width:0.5;" x1="378.5" x2="624.5" y1="312" y2="312"/></g><!--class BridgeInterceptor--><g id="elem_BridgeInterceptor"><rect fill="#F1F1F1" height="48" id="BridgeInterceptor" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="163" x="8" y="380"/><ellipse cx="23" cy="396" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M25.3438,391.6719 C24.4063,391.2344 23.8125,391.0938 22.9375,391.0938 C20.3125,391.0938 18.3125,393.1719 18.3125,395.8906 L18.3125,397.0156 C18.3125,399.5938 20.4219,401.4844 23.3125,401.4844 C24.5313,401.4844 25.6875,401.1875 26.4375,400.6406 C27.0156,400.2344 27.3438,399.7813 27.3438,399.3906 C27.3438,398.9375 26.9531,398.5469 26.4844,398.5469 C26.2656,398.5469 26.0625,398.625 25.875,398.8125 C25.4219,399.2969 25.4219,399.2969 25.2344,399.3906 C24.8125,399.6563 24.125,399.7813 23.3594,399.7813 C21.3125,399.7813 20.0156,398.6875 20.0156,396.9844 L20.0156,395.8906 C20.0156,394.1094 21.2656,392.7969 23,392.7969 C23.5781,392.7969 24.1875,392.9531 24.6563,393.2031 C25.1406,393.4844 25.3125,393.7031 25.4063,394.1094 C25.4688,394.5156 25.5,394.6406 25.6406,394.7656 C25.7813,394.9063 26.0156,395.0156 26.2344,395.0156 C26.5,395.0156 26.7656,394.875 26.9375,394.6563 C27.0469,394.5 27.0781,394.3125 27.0781,393.8906 L27.0781,392.4688 C27.0781,392.0313 27.0625,391.9063 26.9688,391.75 C26.8125,391.4844 26.5313,391.3438 26.2344,391.3438 C25.9375,391.3438 25.7344,391.4375 25.5156,391.75 L25.3438,391.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="131" x="37" y="400.8467">BridgeInterceptor</text><line style="stroke:#181818;stroke-width:0.5;" x1="9" x2="170" y1="412" y2="412"/><line style="stroke:#181818;stroke-width:0.5;" x1="9" x2="170" y1="420" y2="420"/></g><!--class CacheInterceptor--><g id="elem_CacheInterceptor"><rect fill="#F1F1F1" height="48" id="CacheInterceptor" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="160" x="206.5" y="380"/><ellipse cx="221.5" cy="396" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M223.8438,391.6719 C222.9063,391.2344 222.3125,391.0938 221.4375,391.0938 C218.8125,391.0938 216.8125,393.1719 216.8125,395.8906 L216.8125,397.0156 C216.8125,399.5938 218.9219,401.4844 221.8125,401.4844 C223.0313,401.4844 224.1875,401.1875 224.9375,400.6406 C225.5156,400.2344 225.8438,399.7813 225.8438,399.3906 C225.8438,398.9375 225.4531,398.5469 224.9844,398.5469 C224.7656,398.5469 224.5625,398.625 224.375,398.8125 C223.9219,399.2969 223.9219,399.2969 223.7344,399.3906 C223.3125,399.6563 222.625,399.7813 221.8594,399.7813 C219.8125,399.7813 218.5156,398.6875 218.5156,396.9844 L218.5156,395.8906 C218.5156,394.1094 219.7656,392.7969 221.5,392.7969 C222.0781,392.7969 222.6875,392.9531 223.1563,393.2031 C223.6406,393.4844 223.8125,393.7031 223.9063,394.1094 C223.9688,394.5156 224,394.6406 224.1406,394.7656 C224.2813,394.9063 224.5156,395.0156 224.7344,395.0156 C225,395.0156 225.2656,394.875 225.4375,394.6563 C225.5469,394.5 225.5781,394.3125 225.5781,393.8906 L225.5781,392.4688 C225.5781,392.0313 225.5625,391.9063 225.4688,391.75 C225.3125,391.4844 225.0313,391.3438 224.7344,391.3438 C224.4375,391.3438 224.2344,391.4375 224.0156,391.75 L223.8438,391.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="128" x="235.5" y="400.8467">CacheInterceptor</text><line style="stroke:#181818;stroke-width:0.5;" x1="207.5" x2="365.5" y1="412" y2="412"/><line style="stroke:#181818;stroke-width:0.5;" x1="207.5" x2="365.5" y1="420" y2="420"/></g><!--class ConnectInterceptor--><g id="elem_ConnectInterceptor"><rect fill="#F1F1F1" height="48" id="ConnectInterceptor" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="177" x="402" y="380"/><ellipse cx="417" cy="396" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M419.3438,391.6719 C418.4063,391.2344 417.8125,391.0938 416.9375,391.0938 C414.3125,391.0938 412.3125,393.1719 412.3125,395.8906 L412.3125,397.0156 C412.3125,399.5938 414.4219,401.4844 417.3125,401.4844 C418.5313,401.4844 419.6875,401.1875 420.4375,400.6406 C421.0156,400.2344 421.3438,399.7813 421.3438,399.3906 C421.3438,398.9375 420.9531,398.5469 420.4844,398.5469 C420.2656,398.5469 420.0625,398.625 419.875,398.8125 C419.4219,399.2969 419.4219,399.2969 419.2344,399.3906 C418.8125,399.6563 418.125,399.7813 417.3594,399.7813 C415.3125,399.7813 414.0156,398.6875 414.0156,396.9844 L414.0156,395.8906 C414.0156,394.1094 415.2656,392.7969 417,392.7969 C417.5781,392.7969 418.1875,392.9531 418.6563,393.2031 C419.1406,393.4844 419.3125,393.7031 419.4063,394.1094 C419.4688,394.5156 419.5,394.6406 419.6406,394.7656 C419.7813,394.9063 420.0156,395.0156 420.2344,395.0156 C420.5,395.0156 420.7656,394.875 420.9375,394.6563 C421.0469,394.5 421.0781,394.3125 421.0781,393.8906 L421.0781,392.4688 C421.0781,392.0313 421.0625,391.9063 420.9688,391.75 C420.8125,391.4844 420.5313,391.3438 420.2344,391.3438 C419.9375,391.3438 419.7344,391.4375 419.5156,391.75 L419.3438,391.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="145" x="431" y="400.8467">ConnectInterceptor</text><line style="stroke:#181818;stroke-width:0.5;" x1="403" x2="578" y1="412" y2="412"/><line style="stroke:#181818;stroke-width:0.5;" x1="403" x2="578" y1="420" y2="420"/></g><!--class CallServerInterceptor--><g id="elem_CallServerInterceptor"><rect fill="#F1F1F1" height="48" id="CallServerInterceptor" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="189" x="7" y="272"/><ellipse cx="22" cy="288" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M24.3438,283.6719 C23.4063,283.2344 22.8125,283.0938 21.9375,283.0938 C19.3125,283.0938 17.3125,285.1719 17.3125,287.8906 L17.3125,289.0156 C17.3125,291.5938 19.4219,293.4844 22.3125,293.4844 C23.5313,293.4844 24.6875,293.1875 25.4375,292.6406 C26.0156,292.2344 26.3438,291.7813 26.3438,291.3906 C26.3438,290.9375 25.9531,290.5469 25.4844,290.5469 C25.2656,290.5469 25.0625,290.625 24.875,290.8125 C24.4219,291.2969 24.4219,291.2969 24.2344,291.3906 C23.8125,291.6563 23.125,291.7813 22.3594,291.7813 C20.3125,291.7813 19.0156,290.6875 19.0156,288.9844 L19.0156,287.8906 C19.0156,286.1094 20.2656,284.7969 22,284.7969 C22.5781,284.7969 23.1875,284.9531 23.6563,285.2031 C24.1406,285.4844 24.3125,285.7031 24.4063,286.1094 C24.4688,286.5156 24.5,286.6406 24.6406,286.7656 C24.7813,286.9063 25.0156,287.0156 25.2344,287.0156 C25.5,287.0156 25.7656,286.875 25.9375,286.6563 C26.0469,286.5 26.0781,286.3125 26.0781,285.8906 L26.0781,284.4688 C26.0781,284.0313 26.0625,283.9063 25.9688,283.75 C25.8125,283.4844 25.5313,283.3438 25.2344,283.3438 C24.9375,283.3438 24.7344,283.4375 24.5156,283.75 L24.3438,283.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="157" x="36" y="292.8467">CallServerInterceptor</text><line style="stroke:#181818;stroke-width:0.5;" x1="8" x2="195" y1="304" y2="304"/><line style="stroke:#181818;stroke-width:0.5;" x1="8" x2="195" y1="312" y2="312"/></g><!--reverse link RealCall to OkHttpClient--><g id="link_RealCall_OkHttpClient"><path codeline="1" d="M508.219,31 C519.724,31 519.229,31 530.734,31 " fill="none" id="RealCall-backto-OkHttpClient" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="496.219,31,502.219,35,508.219,31,502.219,27,496.219,31" style="stroke:#181818;stroke-width:1.0;"/></g><!--link RealCall to RealInterceptorChain--><g id="link_RealCall_RealInterceptorChain"><path codeline="2" d="M451.5,55.03 C451.5,71.567 451.5,88.444 451.5,108.843 " fill="none" id="RealCall-to-RealInterceptorChain" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="451.5,114.843,455.5,105.843,451.5,109.843,447.5,105.843,451.5,114.843" style="stroke:#181818;stroke-width:1.0;"/></g><!--link RealCall to Interceptor--><g id="link_RealCall_Interceptor"><path codeline="3" d="M406.826,46.572 C374.936,59.398 333.874,81.354 311.5,115 C279.355,163.34 279.9831,229.2027 283.1711,265.7877 " fill="none" id="RealCall-to-Interceptor" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="283.692,271.765,286.8956,262.4517,283.2579,266.7839,278.9258,263.1462,283.692,271.765" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link RealCall to ExchangeFinder--><g id="link_RealCall_ExchangeFinder"><path codeline="4" d="M507.35,53.0588 C513.194,55.1458 507.822,53.154 513.5,55 C607.44,85.537 664.392,39.009 727.5,115 C764.681,159.771 756.38,234.17 748.988,271.752 " fill="none" id="RealCall-backto-ExchangeFinder" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="496.049,49.023,500.3542,54.8079,507.35,53.0588,503.0448,47.2739,496.049,49.023" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link ExchangeFinder to RealConnectionPool--><g id="link_ExchangeFinder_RealConnectionPool"><path codeline="5" d="M743.5,332 C743.5,349.6584 743.5,361.9408 743.5,379.6784 " fill="none" id="ExchangeFinder-backto-RealConnectionPool" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="743.5,320,739.5,326,743.5,332,747.5,326,743.5,320" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link Exchange to ExchangeFinder--><g id="link_Exchange_ExchangeFinder"><path codeline="6" d="M680.8189,197.6204 C696.0789,221.3284 713.232,247.977 728.541,271.761 " fill="none" id="Exchange-backto-ExchangeFinder" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="674.324,187.53,674.2079,194.7402,680.8189,197.6204,680.9349,190.4103,674.324,187.53" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link RealInterceptorChain to Exchange--><g id="link_RealInterceptorChain_Exchange"><path codeline="7" d="M585.781,163.5 C597.501,163.5 597.22,163.5 608.939,163.5 " fill="none" id="RealInterceptorChain-backto-Exchange" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="573.781,163.5,579.781,167.5,585.781,163.5,579.781,159.5,573.781,163.5" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link RealInterceptorChain to Interceptor--><g id="link_RealInterceptorChain_Interceptor"><path codeline="15" d="M381.585,219.7961 C356.016,240.0191 336.818,255.203 316.008,271.662 " fill="none" id="RealInterceptorChain-backto-Interceptor" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="390.997,212.352,383.8096,212.9367,381.585,219.7961,388.7724,219.2114,390.997,212.352" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="8" x="374.3294" y="232.0075">1</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="8" x="314.2256" y="260.9846">n</text></g><!--reverse link Interceptor to RetryAndFollowUpInterceptor--><g id="link_Interceptor_RetryAndFollowUpInterceptor"><path codeline="17" d="M360.35,296 C372.058,296 365.766,296 377.475,296 " fill="none" id="Interceptor-backto-RetryAndFollowUpInterceptor" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="342.35,296,360.35,302,360.35,290,342.35,296" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link Interceptor to BridgeInterceptor--><g id="link_Interceptor_BridgeInterceptor"><path codeline="18" d="M227.9031,328.5292 C194.9731,346.2485 165.497,362.1083 132.502,379.8617 " fill="none" id="Interceptor-backto-BridgeInterceptor" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="243.754,320,225.06,323.2456,230.7461,333.8129,243.754,320" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link Interceptor to CacheInterceptor--><g id="link_Interceptor_CacheInterceptor"><path codeline="19" d="M286.5,338 C286.5,355.6584 286.5,361.9408 286.5,379.6784 " fill="none" id="Interceptor-backto-CacheInterceptor" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="286.5,320,280.5,338,292.5,338,286.5,320" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link Interceptor to ConnectInterceptor--><g id="link_Interceptor_ConnectInterceptor"><path codeline="20" d="M346.7373,328.2997 C380.8373,346.019 411.803,362.1083 445.97,379.8617 " fill="none" id="Interceptor-backto-ConnectInterceptor" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="330.765,320,343.9708,333.6238,349.5039,322.9756,330.765,320" style="stroke:#181818;stroke-width:1.0;"/></g><!--link CallServerInterceptor to Interceptor--><g id="link_CallServerInterceptor_Interceptor"><path codeline="21" d="M196.168,296 C207.695,296 201.221,296 212.748,296 " fill="none" id="CallServerInterceptor-to-Interceptor" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="230.748,296,212.748,290,212.748,302,230.748,296" style="stroke:#181818;stroke-width:1.0;"/></g><!--SRC=[XP51ImCn48Nl-HN3dbJ8mMif1Lqi2WLbnHyGijDkS9YaoQWLzR-xMRLcozBczdZVlBn96ZHK6oAuq73_V2iIQdB8efe_G-i5P777Wj5Y41_hpZWU4uNxR_IPDplR6TxWqd6BKOrb3-WXk_RCQCLvVl2UzjJW7oHCLIalKifbTsqiZafPCYbDBW8V2lgJutUpFFChzrIQmSebcHU3Yu5fC0NF2I54Rn7RimQtBvW4uhdwccvQNLR3LXLNetgg433_pCyYyVsAswKdyczFeOGFM0tNqRKRF8hKndOdY9zFEC8GhYKd4JrYVCLOsDy0]--></g></svg>

<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentstyletype="text/css" height="389px" preserveAspectRatio="none" style="width:570px;height:389px;background:#FFFFFF;" version="1.1" viewBox="0 0 570 389" width="570px" zoomAndPan="magnify"><defs/><g><rect fill="#FFFFFF" height="241.0938" style="stroke:#181818;stroke-width:1.0;" width="10" x="79" y="104.5625"/><rect fill="#FFFFFF" height="123.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="312" y="222.125"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="83.5" x2="83.5" y1="36.2969" y2="354.6563"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="316.5" x2="316.5" y1="190.3438" y2="354.6563"/><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="71" x="48.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="57" x="55.5" y="24.9951">RealCall</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="71" x="48.5" y="353.6563"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="57" x="55.5" y="373.6514">RealCall</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="169" x="232.5" y="353.6563"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="155" x="239.5" y="373.6514">RealInterceptorChain</text><rect fill="#FFFFFF" height="241.0938" style="stroke:#181818;stroke-width:1.0;" width="10" x="79" y="104.5625"/><rect fill="#FFFFFF" height="123.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="312" y="222.125"/><ellipse cx="7.5" cy="66.6797" fill="none" rx="4" ry="4" style="stroke:#181818;stroke-width:1.5;"/><polygon fill="#181818" points="72,63.4297,82,67.4297,72,71.4297,76,67.4297" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="12" x2="78" y1="67.4297" y2="67.4297"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="52" x="15" y="62.3638">execute</text><line style="stroke:#181818;stroke-width:1.0;" x1="84" x2="131" y1="91.5625" y2="91.5625"/><line style="stroke:#181818;stroke-width:1.0;" x1="131" x2="131" y1="91.5625" y2="104.5625"/><line style="stroke:#181818;stroke-width:1.0;" x1="90" x2="131" y1="104.5625" y2="104.5625"/><polygon fill="#181818" points="100,100.5625,90,104.5625,100,108.5625,96,104.5625" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="219" x="96" y="86.4966">getResponseWithInterceptorChain</text><line style="stroke:#181818;stroke-width:1.0;" x1="89" x2="131" y1="138.6953" y2="138.6953"/><line style="stroke:#181818;stroke-width:1.0;" x1="131" x2="131" y1="138.6953" y2="151.6953"/><line style="stroke:#181818;stroke-width:1.0;" x1="90" x2="131" y1="151.6953" y2="151.6953"/><polygon fill="#181818" points="100,147.6953,90,151.6953,100,155.6953,96,151.6953" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="122" x="96" y="133.6294">&#21019;&#24314;Interceptor List</text><polygon fill="#181818" points="220.5,176.8281,230.5,180.8281,220.5,184.8281,224.5,180.8281" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="89" x2="226.5" y1="180.8281" y2="180.8281"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="27" x="96" y="175.7622">new</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="169" x="232.5" y="159.6953"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="155" x="239.5" y="179.6904">RealInterceptorChain</text><polygon fill="#181818" points="300,218.125,310,222.125,300,226.125,304,222.125" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="89" x2="306" y1="222.125" y2="222.125"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="52" x="96" y="217.0591">proceed</text><line style="stroke:#181818;stroke-width:1.0;" x1="322" x2="364" y1="266.3906" y2="266.3906"/><line style="stroke:#181818;stroke-width:1.0;" x1="364" x2="364" y1="266.3906" y2="279.3906"/><line style="stroke:#181818;stroke-width:1.0;" x1="323" x2="364" y1="279.3906" y2="279.3906"/><polygon fill="#181818" points="333,275.3906,323,279.3906,333,283.3906,329,279.3906" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="141" x="329" y="246.1919">next = copy(index+1)</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="234" x="329" y="261.3247">&#22797;&#21046;&#24403;&#21069;&#36131;&#20219;&#38142;&#65292;&#25351;&#38024;&#25351;&#21521;&#19979;&#19968;&#20010;&#25318;&#25130;&#22120;</text><line style="stroke:#181818;stroke-width:1.0;" x1="322" x2="364" y1="323.6563" y2="323.6563"/><line style="stroke:#181818;stroke-width:1.0;" x1="364" x2="364" y1="323.6563" y2="336.6563"/><line style="stroke:#181818;stroke-width:1.0;" x1="323" x2="364" y1="336.6563" y2="336.6563"/><polygon fill="#181818" points="333,332.6563,323,336.6563,333,340.6563,329,336.6563" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="96" x="329" y="303.4575">intercept(next)</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="65" x="329" y="318.5903">&#25191;&#34892;&#25318;&#25130;&#22120;</text><!--SRC=[YyxNjLC8IatCSKxCoL6mKaYjI4qkBKdbWWiXIsjhMocafvO4fHONvESLfuPdbcHuvfMa5YMd5fJa5pbd96RcOTTefV2qO_RJtRkGL2luP1QNSAaheAelAQfqp4jnoy_9oIyFBK1MhgK5D2KljHnDYrDHPafwAX4AdHEJCuXIbv-NbvfSGfI9EJd1gKLbgKLO5QC717f8aQ0I5Eu5HVd9gQafN5WLuD88Ch-YHC5M8Jc_e58ZCoybjKBRK3Ccx-cItgSTsvxkdVoqi_V5biLFTkz-ENdV-pqzpthQNqxg099F9qnyigFxoOw69pjMFUjUzgnZrTEPAqYrEnCcf05o1T3QPvtBNopiWPi70000]--></g></svg>

<p>okhttp的拦截器分为<strong>应用拦截器</strong>和<strong>网络拦截器</strong>，拦截器按照顺序执行，看下RealCall.getResponseWithInterceptorChain中拦截器的顺序定义：</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">internal</span> <span class="function"><span class="keyword">fun</span> <span class="title">getResponseWithInterceptorChain</span><span class="params">()</span></span>: Response &#123;</span><br><span class="line">  <span class="comment">// Build a full stack of interceptors.</span></span><br><span class="line">  <span class="keyword">val</span> interceptors = mutableListOf&lt;Interceptor&gt;()</span><br><span class="line">  <span class="comment">//1.添加用户注册的应用拦截器</span></span><br><span class="line">  interceptors += client.interceptors </span><br><span class="line">  <span class="comment">//2.添加重试重定向拦截器</span></span><br><span class="line">  interceptors += RetryAndFollowUpInterceptor(client)</span><br><span class="line">  <span class="comment">//3.添加桥接拦截器，用于用户数据和网络数据之间的相互转换</span></span><br><span class="line">  interceptors += BridgeInterceptor(client.cookieJar)</span><br><span class="line">  <span class="comment">//4.添加缓存拦截器</span></span><br><span class="line">  interceptors += CacheInterceptor(client.cache)</span><br><span class="line">  <span class="comment">//5.连接拦截器，负责跟服务器建立连接</span></span><br><span class="line">  interceptors += ConnectInterceptor</span><br><span class="line">  <span class="keyword">if</span> (!forWebSocket) &#123;</span><br><span class="line">    <span class="comment">//6.添加用户自定义网络拦截器</span></span><br><span class="line">    interceptors += client.networkInterceptors</span><br><span class="line">  &#125;</span><br><span class="line">  <span class="comment">//7.服务请求连接器</span></span><br><span class="line">  interceptors += CallServerInterceptor(forWebSocket)</span><br><span class="line"></span><br><span class="line">  <span class="keyword">val</span> chain = RealInterceptorChain(</span><br><span class="line">    call = <span class="keyword">this</span>,</span><br><span class="line">    interceptors = interceptors,</span><br><span class="line">    index = <span class="number">0</span>,</span><br><span class="line">    exchange = <span class="literal">null</span>,</span><br><span class="line">    request = originalRequest,</span><br><span class="line">    connectTimeoutMillis = client.connectTimeoutMillis,</span><br><span class="line">    readTimeoutMillis = client.readTimeoutMillis,</span><br><span class="line">    writeTimeoutMillis = client.writeTimeoutMillis</span><br><span class="line">  )</span><br><span class="line">  <span class="comment">//后面代码省略</span></span><br></pre></td></tr></table></figure>

<h2 id="拦截器的处理时序"><a href="#拦截器的处理时序" class="headerlink" title="拦截器的处理时序"></a>拦截器的处理时序</h2><p>这个是简化版的连接器处理时序，连接器调用到下一个都是要经过<code>RealInterceptorChain.proceed</code>，这里面逻辑比较简单，就是找到下一个连接器并执行，这个细节时序图中没有体现。</p>
<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentstyletype="text/css" height="822px" preserveAspectRatio="none" style="width:867px;height:822px;background:#FFFFFF;" version="1.1" viewBox="0 0 867 822" width="867px" zoomAndPan="magnify"><defs/><g><rect fill="#FFFFFF" height="14" style="stroke:#181818;stroke-width:1.0;" width="10" x="84" y="67.4297"/><rect fill="#FFFFFF" height="23" style="stroke:#181818;stroke-width:1.0;" width="10" x="84" y="754.9531"/><rect fill="#FFFFFF" height="95.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="199" y="81.4297"/><rect fill="#FFFFFF" height="101.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="199" y="653.4219"/><rect fill="#FFFFFF" height="71.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="325" y="176.8281"/><rect fill="#FFFFFF" height="78.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="325" y="575.1563"/><rect fill="#FFFFFF" height="56.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="442" y="248.0938"/><rect fill="#FFFFFF" height="56.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="442" y="519.0234"/><rect fill="#FFFFFF" height="101.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="544" y="304.2266"/><rect fill="#FFFFFF" height="14" style="stroke:#181818;stroke-width:1.0;" width="10" x="544" y="505.0234"/><rect fill="#FFFFFF" height="14" style="stroke:#181818;stroke-width:1.0;" width="10" x="672" y="405.7578"/><rect fill="#FFFFFF" height="14" style="stroke:#181818;stroke-width:1.0;" width="10" x="672" y="491.0234"/><rect fill="#FFFFFF" height="71.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="780" y="419.7578"/><rect fill="none" height="486.7266" style="stroke:#000000;stroke-width:1.5;" width="730" x="131" y="153.6953"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="89" x2="89" y1="36.2969" y2="786.9531"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="204" x2="204" y1="36.2969" y2="786.9531"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="330" x2="330" y1="36.2969" y2="786.9531"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="447" x2="447" y1="36.2969" y2="786.9531"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="549" x2="549" y1="36.2969" y2="786.9531"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="677" x2="677" y1="36.2969" y2="786.9531"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="785" x2="785" y1="36.2969" y2="786.9531"/><rect fill="#FFFFFF" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="84" x="47" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="70" x="54" y="24.9951">&#24212;&#29992;&#25318;&#25130;&#22120;</text><rect fill="#FFFFFF" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="84" x="47" y="785.9531"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="70" x="54" y="805.9482">&#24212;&#29992;&#25318;&#25130;&#22120;</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="126" x="141" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="112" x="148" y="24.9951">&#37325;&#35797;&#37325;&#23450;&#21521;&#25318;&#25130;&#22120;</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="126" x="141" y="785.9531"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="112" x="148" y="805.9482">&#37325;&#35797;&#37325;&#23450;&#21521;&#25318;&#25130;&#22120;</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="84" x="288" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="70" x="295" y="24.9951">&#26725;&#25509;&#25318;&#25130;&#22120;</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="84" x="288" y="785.9531"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="70" x="295" y="805.9482">&#26725;&#25509;&#25318;&#25130;&#22120;</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="84" x="405" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="70" x="412" y="24.9951">&#32531;&#23384;&#25318;&#25130;&#22120;</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="84" x="405" y="785.9531"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="70" x="412" y="805.9482">&#32531;&#23384;&#25318;&#25130;&#22120;</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="84" x="507" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="70" x="514" y="24.9951">&#36830;&#25509;&#25318;&#25130;&#22120;</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="84" x="507" y="785.9531"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="70" x="514" y="805.9482">&#36830;&#25509;&#25318;&#25130;&#22120;</text><rect fill="#FFFFFF" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="84" x="635" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="70" x="642" y="24.9951">&#32593;&#32476;&#25318;&#25130;&#22120;</text><rect fill="#FFFFFF" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="84" x="635" y="785.9531"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="70" x="642" y="805.9482">&#32593;&#32476;&#25318;&#25130;&#22120;</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="112" x="729" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="98" x="736" y="24.9951">&#26381;&#21153;&#35831;&#27714;&#25318;&#25130;&#22120;</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="112" x="729" y="785.9531"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="98" x="736" y="805.9482">&#26381;&#21153;&#35831;&#27714;&#25318;&#25130;&#22120;</text><rect fill="#FFFFFF" height="14" style="stroke:#181818;stroke-width:1.0;" width="10" x="84" y="67.4297"/><rect fill="#FFFFFF" height="23" style="stroke:#181818;stroke-width:1.0;" width="10" x="84" y="754.9531"/><rect fill="#FFFFFF" height="95.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="199" y="81.4297"/><rect fill="#FFFFFF" height="101.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="199" y="653.4219"/><rect fill="#FFFFFF" height="71.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="325" y="176.8281"/><rect fill="#FFFFFF" height="78.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="325" y="575.1563"/><rect fill="#FFFFFF" height="56.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="442" y="248.0938"/><rect fill="#FFFFFF" height="56.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="442" y="519.0234"/><rect fill="#FFFFFF" height="101.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="544" y="304.2266"/><rect fill="#FFFFFF" height="14" style="stroke:#181818;stroke-width:1.0;" width="10" x="544" y="505.0234"/><rect fill="#FFFFFF" height="14" style="stroke:#181818;stroke-width:1.0;" width="10" x="672" y="405.7578"/><rect fill="#FFFFFF" height="14" style="stroke:#181818;stroke-width:1.0;" width="10" x="672" y="491.0234"/><rect fill="#FFFFFF" height="71.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="780" y="419.7578"/><ellipse cx="7.5" cy="66.6797" fill="none" rx="4" ry="4" style="stroke:#181818;stroke-width:1.5;"/><polygon fill="#181818" points="72,63.4297,82,67.4297,72,71.4297,76,67.4297" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="12" x2="78" y1="67.4297" y2="67.4297"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="57" x="15" y="62.3638">intercept</text><polygon fill="#181818" points="187,77.4297,197,81.4297,187,85.4297,191,81.4297" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="89" x2="193" y1="81.4297" y2="81.4297"/><line style="stroke:#181818;stroke-width:1.0;" x1="209" x2="251" y1="125.6953" y2="125.6953"/><line style="stroke:#181818;stroke-width:1.0;" x1="251" x2="251" y1="125.6953" y2="138.6953"/><line style="stroke:#181818;stroke-width:1.0;" x1="210" x2="251" y1="138.6953" y2="138.6953"/><polygon fill="#181818" points="220,134.6953,210,138.6953,220,142.6953,216,138.6953" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="39" x="216" y="105.4966">&#21021;&#22987;&#21270;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="102" x="216" y="120.6294">ExchangeFinder</text><path d="M131,153.6953 L344,153.6953 L344,160.8281 L334,170.8281 L131,170.8281 L131,153.6953 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.5;"/><rect fill="none" height="486.7266" style="stroke:#000000;stroke-width:1.5;" width="730" x="131" y="153.6953"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="168" x="146" y="166.7622">&#37325;&#35797;&#21644;&#37325;&#23450;&#21521;&#22330;&#26223;&#36816;&#34892;&#22810;&#27425;</text><polygon fill="#181818" points="313,172.8281,323,176.8281,313,180.8281,317,176.8281" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="204" x2="319" y1="176.8281" y2="176.8281"/><line style="stroke:#181818;stroke-width:1.0;" x1="335" x2="377" y1="221.0938" y2="221.0938"/><line style="stroke:#181818;stroke-width:1.0;" x1="377" x2="377" y1="221.0938" y2="234.0938"/><line style="stroke:#181818;stroke-width:1.0;" x1="336" x2="377" y1="234.0938" y2="234.0938"/><polygon fill="#181818" points="346,230.0938,336,234.0938,346,238.0938,342,234.0938" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="78" x="342" y="200.895">&#22788;&#29702;&#35831;&#27714;&#22836;&#65292;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="93" x="342" y="216.0278">&#21253;&#25324;&#21152;&#36733;cookie</text><polygon fill="#181818" points="430,244.0938,440,248.0938,430,252.0938,434,248.0938" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="330" x2="436" y1="248.0938" y2="248.0938"/><line style="stroke:#181818;stroke-width:1.0;" x1="452" x2="494" y1="277.2266" y2="277.2266"/><line style="stroke:#181818;stroke-width:1.0;" x1="494" x2="494" y1="277.2266" y2="290.2266"/><line style="stroke:#181818;stroke-width:1.0;" x1="453" x2="494" y1="290.2266" y2="290.2266"/><polygon fill="#181818" points="463,286.2266,453,290.2266,463,294.2266,459,290.2266" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="78" x="459" y="272.1606">&#21152;&#36733;&#26412;&#22320;&#32531;&#23384;</text><polygon fill="#181818" points="532,300.2266,542,304.2266,532,308.2266,536,304.2266" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="447" x2="538" y1="304.2266" y2="304.2266"/><line style="stroke:#181818;stroke-width:1.0;" x1="554" x2="596" y1="378.7578" y2="378.7578"/><line style="stroke:#181818;stroke-width:1.0;" x1="596" x2="596" y1="378.7578" y2="391.7578"/><line style="stroke:#181818;stroke-width:1.0;" x1="555" x2="596" y1="391.7578" y2="391.7578"/><polygon fill="#181818" points="565,387.7578,555,391.7578,565,395.7578,561,391.7578" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="104" x="561" y="328.2935">&#32531;&#23384;&#27744;&#33719;&#21462;&#21487;&#29992;&#36830;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="91" x="561" y="343.4263">&#25509;&#25110;&#26032;&#24314;&#36830;&#25509;&#65292;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="102" x="561" y="358.5591">&#21019;&#24314;Exchange&#21644;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="72" x="561" y="373.6919">HTTP&#35299;&#30721;&#22120;</text><polygon fill="#181818" points="660,401.7578,670,405.7578,660,409.7578,664,405.7578" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="549" x2="666" y1="405.7578" y2="405.7578"/><polygon fill="#181818" points="768,415.7578,778,419.7578,768,423.7578,772,419.7578" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="677" x2="774" y1="419.7578" y2="419.7578"/><line style="stroke:#181818;stroke-width:1.0;" x1="790" x2="832" y1="464.0234" y2="464.0234"/><line style="stroke:#181818;stroke-width:1.0;" x1="832" x2="832" y1="464.0234" y2="477.0234"/><line style="stroke:#181818;stroke-width:1.0;" x1="791" x2="832" y1="477.0234" y2="477.0234"/><polygon fill="#181818" points="801,473.0234,791,477.0234,801,481.0234,797,477.0234" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="52" x="797" y="443.8247">&#21457;&#36865;&#35831;&#27714;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="52" x="797" y="458.9575">&#35299;&#26512;&#21709;&#24212;</text><polygon fill="#181818" points="693,487.0234,683,491.0234,693,495.0234,689,491.0234" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="687" x2="784" y1="491.0234" y2="491.0234"/><polygon fill="#181818" points="565,501.0234,555,505.0234,565,509.0234,561,505.0234" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="559" x2="676" y1="505.0234" y2="505.0234"/><polygon fill="#181818" points="463,515.0234,453,519.0234,463,523.0234,459,519.0234" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="457" x2="548" y1="519.0234" y2="519.0234"/><line style="stroke:#181818;stroke-width:1.0;" x1="452" x2="494" y1="548.1563" y2="548.1563"/><line style="stroke:#181818;stroke-width:1.0;" x1="494" x2="494" y1="548.1563" y2="561.1563"/><line style="stroke:#181818;stroke-width:1.0;" x1="453" x2="494" y1="561.1563" y2="561.1563"/><polygon fill="#181818" points="463,557.1563,453,561.1563,463,565.1563,459,561.1563" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="52" x="459" y="543.0903">&#20445;&#23384;&#32531;&#23384;</text><polygon fill="#181818" points="346,571.1563,336,575.1563,346,579.1563,342,575.1563" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="340" x2="446" y1="575.1563" y2="575.1563"/><line style="stroke:#181818;stroke-width:1.0;" x1="335" x2="377" y1="619.4219" y2="619.4219"/><line style="stroke:#181818;stroke-width:1.0;" x1="377" x2="377" y1="619.4219" y2="632.4219"/><line style="stroke:#181818;stroke-width:1.0;" x1="336" x2="377" y1="632.4219" y2="632.4219"/><polygon fill="#181818" points="346,628.4219,336,632.4219,346,636.4219,342,632.4219" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="67" x="342" y="599.2231">&#20445;&#23384;cookie</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="52" x="342" y="614.356">gzip&#35299;&#21387;</text><polygon fill="#181818" points="220,649.4219,210,653.4219,220,657.4219,216,653.4219" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="214" x2="329" y1="653.4219" y2="653.4219"/><line style="stroke:#181818;stroke-width:1.0;" x1="209" x2="251" y1="727.9531" y2="727.9531"/><line style="stroke:#181818;stroke-width:1.0;" x1="251" x2="251" y1="727.9531" y2="740.9531"/><line style="stroke:#181818;stroke-width:1.0;" x1="210" x2="251" y1="740.9531" y2="740.9531"/><polygon fill="#181818" points="220,736.9531,210,740.9531,220,744.9531,216,740.9531" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="65" x="216" y="677.4888">&#22788;&#29702;&#24322;&#24120;&#21644;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="65" x="216" y="692.6216">&#36820;&#22238;&#30721;&#20915;&#23450;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="65" x="216" y="707.7544">&#26159;&#21542;&#37325;&#35797;&#12289;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="39" x="216" y="722.8872">&#37325;&#23450;&#21521;</text><polygon fill="#181818" points="105,750.9531,95,754.9531,105,758.9531,101,754.9531" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="99" x2="203" y1="754.9531" y2="754.9531"/><ellipse cx="7.5" cy="768.2031" fill="none" rx="4" ry="4" style="stroke:#181818;stroke-width:1.5;"/><polygon fill="#181818" points="24.5,764.9531,14.5,768.9531,24.5,772.9531,20.5,768.9531" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="22.5" x2="83" y1="768.9531" y2="768.9531"/><!--SRC=[jLHDIm9H5DtFhn1QYdz0ebtHiaMxPYCsw12y6MIYQ9LI9ZhgM2PzJABaHuGrHe7Y1_wOkczUg_v2Drz5p1ibY3QpEFUSS-zxzypJ8mb3ZQfwX1W169JTyWtDjMZc5ivl0WixSTLGf0qjj2JKWi5mG2M6aeWgkY5vgoXuFSepvnI_S7y1Lkb7BHGCIhEhSvJX06Ike9q3ioAJvTreF49YoefADfM454jes_gd58xDRpNO0thki8d5wYOqBcYdFhSthJTfeUaPLW157exME72jD7Dwz245ZQUtaIaJC0zfhWFP6XkFevgsfIf-Nkxe1ExEF3q5KEHXpwapjJjWTtdLJyScLV5C0YZombyT7sgiq8DY1OeERXbfClaWPYgqqeNXWEluWJEN27oj1lSWazNrzJNMldPhIVIKz1znSySbTsWBSVEPpClaD-G5SIjs7h9rlWFl3lrBipHujyNIwtwIupB14z2g1ITvJFeihryF-kkT_2aSBvChH6R5uazPvzOyqJA9xQawtWyKSf92DaM7VtiCfdySZ5BGxq-ZnYPbkAn-92tzY7HCwPa3LejRFEydPVBjCwUdpsCtdN93MmnvA-y0]--></g></svg>

<h2 id="同步和异步请求源码解析"><a href="#同步和异步请求源码解析" class="headerlink" title="同步和异步请求源码解析"></a>同步和异步请求源码解析</h2>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/78efaca4.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/be1f8948.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/be1f8948.html" class="post-title-link" itemprop="url">Flutter点击事件处理机制</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2022-09-10 18:39:35" itemprop="dateCreated datePublished" datetime="2022-09-10T18:39:35+08:00">2022-09-10</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-10-18 16:30:47" itemprop="dateModified" datetime="2023-10-18T16:30:47+08:00">2023-10-18</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/Flutter/" itemprop="url" rel="index"><span itemprop="name">Flutter</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <p>一次点击一般会有先后两个事件：PointerDownEvent和PointerUpEvent，分别表示按下down和抬起up（如果手指发生了滑动，还会有PointerMoveEvent事件）。本文分别分析按下和抬起两个事件的处理流程。</p>
<p>备注：本文以<code>GestureDetector</code>为示例进行点击事件处理流程的分析，基于Flutter 2.5.3。</p>
<h2 id="PointerDownEvent（按下）事件的处理流程"><a href="#PointerDownEvent（按下）事件的处理流程" class="headerlink" title="PointerDownEvent（按下）事件的处理流程"></a>PointerDownEvent（按下）事件的处理流程</h2><?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentstyletype="text/css" height="1341px" preserveAspectRatio="none" style="width:1035px;height:1341px;background:#FFFFFF;" version="1.1" viewBox="0 0 1035 1341" width="1035px" zoomAndPan="magnify"><defs/><g><rect fill="#FFFFFF" height="191.7969" style="stroke:#181818;stroke-width:1.0;" width="10" x="156" y="204.125"/><rect fill="#FFFFFF" height="120.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="161" y="246.2578"/><rect fill="#FFFFFF" height="34.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="166" y="303.5234"/><rect fill="#FFFFFF" height="821.4531" style="stroke:#181818;stroke-width:1.0;" width="10" x="156" y="476.1875"/><rect fill="#FFBBBB" height="423.9922" style="stroke:#181818;stroke-width:1.0;" width="10" x="161" y="850.6484"/><rect fill="#FFFFFF" height="99.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="166" y="892.7813"/><rect fill="#FFFFFF" height="223.0625" style="stroke:#181818;stroke-width:1.0;" width="10" x="166" y="1051.5781"/><rect fill="#C0C0C0" height="156.7969" style="stroke:#181818;stroke-width:1.0;" width="10" x="171" y="1117.8438"/><rect fill="#FFFFFF" height="131.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="587" y="539.4531"/><rect fill="#FFFFFF" height="64.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="592" y="606.8516"/><rect fill="#FFFFFF" height="172.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="810" y="640.9844"/><rect fill="#FFFFFF" height="105.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="815" y="708.1172"/><rect fill="#FFFFFF" height="63.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="820" y="750.25"/><rect fill="#FFFFFF" height="65.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="810" y="926.9141"/><rect fill="#FFFFFF" height="65.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="810" y="1209.2422"/><rect fill="none" height="218.0625" style="stroke:#000000;stroke-width:1.5;" width="896.5" x="88.5" y="1071.5781"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="160.5" x2="160.5" y1="36.2969" y2="1306.6406"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="437" x2="437" y1="121.2109" y2="1306.6406"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="592" x2="592" y1="36.2969" y2="1306.6406"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="814.5" x2="814.5" y1="36.2969" y2="1306.6406"/><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="125" x="98.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="111" x="105.5" y="24.9951">GestureBinding</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="125" x="98.5" y="1305.6406"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="111" x="105.5" y="1325.6357">GestureBinding</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="112" x="381" y="1305.6406"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="98" x="388" y="1325.6357">HitTestResult</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="178" x="503" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="164" x="510" y="24.9951">RenderPointerListener</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="178" x="503" y="1305.6406"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="164" x="510" y="1325.6357">RenderPointerListener</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="179" x="725.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="165" x="732.5" y="24.9951">TapGestureRecognizer</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="179" x="725.5" y="1305.6406"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="165" x="732.5" y="1325.6357">TapGestureRecognizer</text><rect fill="#FFFFFF" height="191.7969" style="stroke:#181818;stroke-width:1.0;" width="10" x="156" y="204.125"/><rect fill="#FFFFFF" height="120.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="161" y="246.2578"/><rect fill="#FFFFFF" height="34.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="166" y="303.5234"/><rect fill="#FFFFFF" height="821.4531" style="stroke:#181818;stroke-width:1.0;" width="10" x="156" y="476.1875"/><rect fill="#FFBBBB" height="423.9922" style="stroke:#181818;stroke-width:1.0;" width="10" x="161" y="850.6484"/><rect fill="#FFFFFF" height="99.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="166" y="892.7813"/><rect fill="#FFFFFF" height="223.0625" style="stroke:#181818;stroke-width:1.0;" width="10" x="166" y="1051.5781"/><rect fill="#C0C0C0" height="156.7969" style="stroke:#181818;stroke-width:1.0;" width="10" x="171" y="1117.8438"/><rect fill="#FFFFFF" height="131.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="587" y="539.4531"/><rect fill="#FFFFFF" height="64.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="592" y="606.8516"/><rect fill="#FFFFFF" height="172.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="810" y="640.9844"/><rect fill="#FFFFFF" height="105.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="815" y="708.1172"/><rect fill="#FFFFFF" height="63.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="820" y="750.25"/><rect fill="#FFFFFF" height="65.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="810" y="926.9141"/><rect fill="#FFFFFF" height="65.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="810" y="1209.2422"/><ellipse cx="7.5" cy="81.8125" fill="none" rx="4" ry="4" style="stroke:#181818;stroke-width:1.5;"/><polygon fill="#181818" points="149,78.5625,159,82.5625,149,86.5625,153,82.5625" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="12" x2="155" y1="82.5625" y2="82.5625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="125" x="15" y="62.3638">handlePointerEvent</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="129" x="15" y="77.4966">(PointerDownEvent)</text><polygon fill="#181818" points="369,107.6953,379,111.6953,369,115.6953,373,111.6953" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="161" x2="375" y1="111.6953" y2="111.6953"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="27" x="168" y="106.6294">new</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="112" x="381" y="90.5625"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="98" x="388" y="110.5576">HitTestResult</text><rect fill="#EEEEEE" height="3" style="stroke:#EEEEEE;stroke-width:1.0;" width="1028" x="0" y="152.4258"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1028" y1="152.4258" y2="152.4258"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1028" y1="155.4258" y2="155.4258"/><rect fill="#EEEEEE" height="23.1328" style="stroke:#000000;stroke-width:2.0;" width="137" x="445.5" y="141.8594"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="118" x="451.5" y="157.9263">&#21629;&#20013;&#27979;&#35797; hitTest</text><line style="stroke:#181818;stroke-width:1.0;" x1="161" x2="208" y1="191.125" y2="191.125"/><line style="stroke:#181818;stroke-width:1.0;" x1="208" x2="208" y1="191.125" y2="204.125"/><line style="stroke:#181818;stroke-width:1.0;" x1="167" x2="208" y1="204.125" y2="204.125"/><polygon fill="#181818" points="177,200.125,167,204.125,177,208.125,173,204.125" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="163" x="173" y="186.0591">(RendererBinding).hitTest</text><line style="stroke:#181818;stroke-width:1.0;" x1="166" x2="213" y1="233.2578" y2="233.2578"/><line style="stroke:#181818;stroke-width:1.0;" x1="213" x2="213" y1="233.2578" y2="246.2578"/><line style="stroke:#181818;stroke-width:1.0;" x1="172" x2="213" y1="246.2578" y2="246.2578"/><polygon fill="#181818" points="182,242.2578,172,246.2578,182,250.2578,178,246.2578" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="121" x="178" y="228.1919">renderView.hitTest</text><line style="stroke:#181818;stroke-width:1.0;" x1="171" x2="218" y1="290.5234" y2="290.5234"/><line style="stroke:#181818;stroke-width:1.0;" x1="218" x2="218" y1="290.5234" y2="303.5234"/><line style="stroke:#181818;stroke-width:1.0;" x1="177" x2="218" y1="303.5234" y2="303.5234"/><polygon fill="#181818" points="187,299.5234,177,303.5234,187,307.5234,183,303.5234" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="82" x="183" y="270.3247">child!.hitTest</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="104" x="183" y="285.4575">&#28145;&#24230;&#20248;&#20808;&#36941;&#21382;&#23376;&#26641;</text><polygon fill="#181818" points="425,333.6563,435,337.6563,425,341.6563,429,337.6563" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="171" x2="431" y1="337.6563" y2="337.6563"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="195" x="178" y="332.5903">add(&#21629;&#20013;&#27979;&#35797;&#36890;&#36807;&#30340;RenderBox)</text><polygon fill="#181818" points="425,362.7891,435,366.7891,425,370.7891,429,366.7891" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="166" x2="431" y1="366.7891" y2="366.7891"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="227" x="173" y="361.7231">add(HitTestEntry(RenderView.this))</text><polygon fill="#181818" points="425,391.9219,435,395.9219,425,399.9219,429,395.9219" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="161" x2="431" y1="395.9219" y2="395.9219"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="247" x="168" y="390.856">add(HitTestEntry(GestureBinding.this))</text><rect fill="#EEEEEE" height="3" style="stroke:#EEEEEE;stroke-width:1.0;" width="1028" x="0" y="424.4883"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1028" y1="424.4883" y2="424.4883"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1028" y1="427.4883" y2="427.4883"/><rect fill="#EEEEEE" height="23.1328" style="stroke:#000000;stroke-width:2.0;" width="143" x="442.5" y="413.9219"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="124" x="448.5" y="429.9888">&#28857;&#20987;down&#20107;&#20214;&#20998;&#21457;</text><line style="stroke:#181818;stroke-width:1.0;" x1="161" x2="208" y1="463.1875" y2="463.1875"/><line style="stroke:#181818;stroke-width:1.0;" x1="208" x2="208" y1="463.1875" y2="476.1875"/><line style="stroke:#181818;stroke-width:1.0;" x1="167" x2="208" y1="476.1875" y2="476.1875"/><polygon fill="#181818" points="177,472.1875,167,476.1875,177,480.1875,173,476.1875" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="91" x="173" y="458.1216">dispatchEvent</text><polygon fill="#181818" points="425,506.3203,435,510.3203,425,514.3203,429,510.3203" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="166" x2="431" y1="510.3203" y2="510.3203"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="156" x="173" y="505.2544">&#33719;&#21462;&#21629;&#20013;&#27979;&#35797;&#30340;target&#21015;&#34920;</text><polygon fill="#181818" points="575,535.4531,585,539.4531,575,543.4531,579,539.4531" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="166" x2="581" y1="539.4531" y2="539.4531"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="80" x="173" y="534.3872">handleEvent</text><line style="stroke:#181818;stroke-width:1.0;" x1="597" x2="644" y1="593.8516" y2="593.8516"/><line style="stroke:#181818;stroke-width:1.0;" x1="644" x2="644" y1="593.8516" y2="606.8516"/><line style="stroke:#181818;stroke-width:1.0;" x1="603" x2="644" y1="606.8516" y2="606.8516"/><polygon fill="#181818" points="613,602.8516,603,606.8516,613,610.8516,609,606.8516" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="177" x="609" y="558.52">onPointerDown?.call(event)</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="199" x="609" y="573.6528">&#23545;&#24212;RawGestureDetectorState.</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="132" x="609" y="588.7856">_handlePointerDown</text><polygon fill="#181818" points="798,636.9844,808,640.9844,798,644.9844,802,640.9844" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="602" x2="804" y1="640.9844" y2="640.9844"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="116" x="609" y="635.9185">addPointer(event)</text><line style="stroke:#181818;stroke-width:1.0;" x1="820" x2="867" y1="695.1172" y2="695.1172"/><line style="stroke:#181818;stroke-width:1.0;" x1="867" x2="867" y1="695.1172" y2="708.1172"/><line style="stroke:#181818;stroke-width:1.0;" x1="826" x2="867" y1="708.1172" y2="708.1172"/><polygon fill="#181818" points="836,704.1172,826,708.1172,836,712.1172,832,708.1172" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="166" x="832" y="690.0513">addAllowedPointer(event)</text><line style="stroke:#181818;stroke-width:1.0;" x1="825" x2="872" y1="737.25" y2="737.25"/><line style="stroke:#181818;stroke-width:1.0;" x1="872" x2="872" y1="737.25" y2="750.25"/><line style="stroke:#181818;stroke-width:1.0;" x1="831" x2="872" y1="750.25" y2="750.25"/><polygon fill="#181818" points="841,746.25,831,750.25,841,754.25,837,750.25" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="184" x="837" y="732.1841">startTrackingPointer(pointer)</text><polygon fill="#181818" points="177,780.3828,167,784.3828,177,788.3828,173,784.3828" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="171" x2="819" y1="784.3828" y2="784.3828"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="236" x="183" y="779.3169">pointerRouter.addRoute &#21152;&#20837;&#21040;&#36335;&#30001;&#20013;</text><polygon fill="#181818" points="177,809.5156,167,813.5156,177,817.5156,173,813.5156" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="171" x2="814" y1="813.5156" y2="813.5156"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="309" x="183" y="808.4497">gestureArena.add(pointer, this) &#28155;&#21152;&#21040;&#20107;&#20214;&#31454;&#25216;&#22330;</text><line style="stroke:#181818;stroke-width:1.0;" x1="166" x2="213" y1="837.6484" y2="837.6484"/><line style="stroke:#181818;stroke-width:1.0;" x1="213" x2="213" y1="837.6484" y2="850.6484"/><line style="stroke:#181818;stroke-width:1.0;" x1="172" x2="213" y1="850.6484" y2="850.6484"/><polygon fill="#181818" points="182,846.6484,172,850.6484,182,854.6484,178,850.6484" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="80" x="178" y="832.5825">handleEvent</text><line style="stroke:#181818;stroke-width:1.0;" x1="171" x2="218" y1="879.7813" y2="879.7813"/><line style="stroke:#181818;stroke-width:1.0;" x1="218" x2="218" y1="879.7813" y2="892.7813"/><line style="stroke:#181818;stroke-width:1.0;" x1="177" x2="218" y1="892.7813" y2="892.7813"/><polygon fill="#181818" points="187,888.7813,177,892.7813,187,896.7813,183,892.7813" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="173" x="183" y="874.7153">pointerRouter.route(event)</text><polygon fill="#181818" points="798,922.9141,808,926.9141,798,930.9141,802,926.9141" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="176" x2="804" y1="926.9141" y2="926.9141"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="80" x="183" y="921.8481">handleEvent</text><line style="stroke:#181818;stroke-width:1.0;" x1="820" x2="862" y1="991.3125" y2="991.3125"/><line style="stroke:#181818;stroke-width:1.0;" x1="862" x2="862" y1="991.3125" y2="1004.3125"/><line style="stroke:#181818;stroke-width:1.0;" x1="815" x2="862" y1="1004.3125" y2="1004.3125"/><polygon fill="#181818" points="825,1000.3125,815,1004.3125,825,1008.3125,821,1004.3125" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="169" x="827" y="955.981">&#27491;&#24120;&#25353;&#38190;&#25353;&#19979;&#30340;&#24773;&#20917;&#26080;&#25805;&#20316;&#12290;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="169" x="827" y="971.1138">&#22312;&#35302;&#25720;&#28857;&#31227;&#20986;&#25353;&#38190;&#21306;&#22495;&#31561;&#29305;&#27530;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="117" x="827" y="986.2466">&#24773;&#20917;&#20250;&#20570;&#28165;&#29702;&#25805;&#20316;&#12290;</text><line style="stroke:#181818;stroke-width:1.0;" x1="171" x2="218" y1="1038.5781" y2="1038.5781"/><line style="stroke:#181818;stroke-width:1.0;" x1="218" x2="218" y1="1038.5781" y2="1051.5781"/><line style="stroke:#181818;stroke-width:1.0;" x1="177" x2="218" y1="1051.5781" y2="1051.5781"/><polygon fill="#181818" points="187,1047.5781,177,1051.5781,187,1055.5781,183,1051.5781" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="124" x="183" y="1018.3794">gestureArena.close</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="130" x="183" y="1033.5122">&#38459;&#27490;&#26032;&#20107;&#20214;&#31454;&#20105;&#32773;&#21152;&#20837;</text><path d="M88.5,1071.5781 L287.5,1071.5781 L287.5,1078.7109 L277.5,1088.7109 L88.5,1088.7109 L88.5,1071.5781 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.5;"/><rect fill="none" height="218.0625" style="stroke:#000000;stroke-width:1.5;" width="896.5" x="88.5" y="1071.5781"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="154" x="103.5" y="1084.645">&#21482;&#26377;&#19968;&#20010;&#31454;&#20105;&#32773;&#25165;&#20250;&#25191;&#34892;</text><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="176" x2="223" y1="1104.8438" y2="1104.8438"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="223" x2="223" y1="1104.8438" y2="1117.8438"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="182" x2="223" y1="1117.8438" y2="1117.8438"/><polygon fill="#181818" points="192,1113.8438,182,1117.8438,192,1121.8438,188,1117.8438" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="117" x="188" y="1099.7778">scheduleMicrotask</text><line style="stroke:#181818;stroke-width:1.0;" x1="181" x2="223" y1="1167.1094" y2="1167.1094"/><line style="stroke:#181818;stroke-width:1.0;" x1="223" x2="223" y1="1167.1094" y2="1180.1094"/><line style="stroke:#181818;stroke-width:1.0;" x1="182" x2="223" y1="1180.1094" y2="1180.1094"/><polygon fill="#181818" points="192,1176.1094,182,1180.1094,192,1184.1094,188,1180.1094" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="144" x="188" y="1146.9106">GestureArenaManager</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="164" x="188" y="1162.0435">&#21024;&#38500;pointer id&#23545;&#24212;&#30340;&#31454;&#25216;&#22330;</text><polygon fill="#181818" points="798,1205.2422,808,1209.2422,798,1213.2422,802,1209.2422" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="181" x2="804" y1="1209.2422" y2="1209.2422"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="169" x="188" y="1204.1763">&#160;&#160;&#160;&#160;&#160;acceptGesture(pointer)</text><line style="stroke:#181818;stroke-width:1.0;" x1="820" x2="862" y1="1273.6406" y2="1273.6406"/><line style="stroke:#181818;stroke-width:1.0;" x1="862" x2="862" y1="1273.6406" y2="1286.6406"/><line style="stroke:#181818;stroke-width:1.0;" x1="815" x2="862" y1="1286.6406" y2="1286.6406"/><polygon fill="#181818" points="825,1282.6406,815,1286.6406,825,1290.6406,821,1286.6406" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="143" x="827" y="1238.3091">&#21807;&#19968;&#30340;&#31454;&#20105;&#32773;&#27492;&#26102;&#24182;&#19981;&#20250;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="143" x="827" y="1253.4419">&#31435;&#21051;&#35302;&#21457;&#28857;&#20987;&#20107;&#20214;&#22238;&#35843;&#65292;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="146" x="827" y="1268.5747">&#32780;&#26159;&#31561;&#24453;up&#20107;&#20214;&#30340;&#21040;&#26469;&#12290;</text><!--SRC=[fLLRJnf167tdLsnZqe1MOr_wO8EDraiVQj9GqvUID9lT2MpSp9BTGTe-uGK5nLjgrLBhfVKM3Q8FAXTjVqntPfUd_eKEkuC2Be8j9BCmEz-PC-SxtpTlbVRkGQ2Xi0fw9IXACC1rSK4UYZ9ufKWG0RL_543aXsxsjq-9G6lAuwg9Q-_cNaXec4xwW1QM4TVQIh4WYBXSNY-7bwxqR9gSpPgPprpGNiTvlGuWDJDjRLsSsmUW25IWiabF1qDeBborejz887A_E24eoUA3SemVaejJdD_JBzTmB5uScyFpKpYzIBQM6YdHnV6YwAvKe1XDcR-cZTIaVR1UvRt79G9UGD8eZq0DbuP2jxVREx3PVeZK3qmowz0eA6cUnlbo0AaEAGFTGRMKQcCyXwSB8ZMAdf_L2-SuFeKNbffEjYXf8Hu9GSjbJP0svo_mmagbkbHNnAi1W71yrTm-SC2mnM6MVYbf242WMhlRthVtTbvrPxW2A-haMOV0ox8RMENYXpYJm_bb7nzXVFe00W9IrDU82jdXX- -gwgu4K9_1C1zYA3uWA04eVMG4Q0hPShPlPR8SuHelSDoi0OaUMLOYe9RBlP4qcaWqhFB22CrS6InaF-l3tUfeBCAdXEdOGUbPlpWyiuLZkpX-ObvaZELJQg3c8GFsH0zjBdm9iSpg4MTL2KSk2YNu-8bT1CRH1fc9ulLyfTnEc_tt-uP5LctoEfNCjGmCzD9FSpLRhQzQUfHJVZk-Rh8hQTtBAQK6ID8_S3PBaedYyZ4TzUmiRGDa8eQdpiZg5laqfr-j_uwEqp9SFp3tzyXIblOfOx-0f_Ds44xcyUQcaKuOYHmvdg7jtWhMBrDuB4MoCMDnwXhbNitQGQygymYoeW4_BAuLIFexMRanZ9vFcD6ORLBE5Q2oXZYyS4ZMwUcYUlRmUWb9p56Q9B5lRYTl4N0oW2O4WHYMmP0ag0hYjP7wDdZUMVesuwh1YaCDyP0F09Mg7TygVjbX_k0aqMw2D3Kt1U50kAv57hOyVjBvjDx82m888HRPk4tKzH9Upb25RP9CuVGEMJt7kNCzMvBQ3usZMHmlK2FHgys-yDXbztN3F9duSvdqGpEQ96iPQYZyCnOEiQoc9cbB8DzsxpRHlxoXhVil]--></g></svg>

<h3 id="命中测试-hitTest"><a href="#命中测试-hitTest" class="headerlink" title="命中测试 hitTest"></a>命中测试 hitTest</h3><p>一次点击事件发生后，会首先进行命中测试。</p>
<p>命中测试hitTest在PointerDownEvent事件的处理流程中进行，从<code>RendererBinding.hitTest</code>开始，然后调用<code>GestureBinding.hitTest</code>，再调用<code>RenderView.hitTest</code>，RenderView会直接调用子节点的hitTest。（其实RendererBinding和GestureBinding都是对应一个WidgetsFlutterBinding类实例，属于继承关系。）RenderView的子节点是RenderBox的子类，从此之后，参与命中测试的组件都是RenderBox或者其子类。hitTest的默认处理逻辑在RenderBox中实现：</p>
<figure class="highlight dart"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">abstract</span> <span class="class"><span class="keyword">class</span> <span class="title">RenderBox</span> <span class="keyword">extends</span> <span class="title">RenderObject</span> </span>&#123;</span><br><span class="line">  <span class="built_in">bool</span> hitTest(BoxHitTestResult result, &#123; <span class="keyword">required</span> Offset position &#125;) &#123;</span><br><span class="line">    <span class="keyword">if</span> (_size!.contains(position)) &#123;</span><br><span class="line">      <span class="keyword">if</span> (hitTestChildren(result, position: position) || hitTestSelf(position)) &#123;</span><br><span class="line">        result.add(BoxHitTestEntry(<span class="keyword">this</span>, position));</span><br><span class="line">        <span class="keyword">return</span> <span class="keyword">true</span>;</span><br><span class="line">      &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">return</span> <span class="keyword">false</span>;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>处理逻辑解读：</p>
<ul>
<li>先判断点击的坐标是否在控件范围内，如果在，则表示命中测试，否则就返回，不会再对子节点进行命中测试；</li>
<li>执行hitTestChildren判断子节点是否命中测试，如果命中就加入到HitTestResult中；</li>
<li>最后把自己加入到HitTestResult中。</li>
</ul>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/be1f8948.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/30614.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/30614.html" class="post-title-link" itemprop="url">算法复杂度</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2020-12-04 10:46:53" itemprop="dateCreated datePublished" datetime="2020-12-04T10:46:53+08:00">2020-12-04</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-08-17 09:46:48" itemprop="dateModified" datetime="2023-08-17T09:46:48+08:00">2023-08-17</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/" itemprop="url" rel="index"><span itemprop="name">数据结构</span></a>
        </span>
    </span>

  
</div>

            <div class="post-description">介绍算法复杂度概念</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/2588.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/2588.html" class="post-title-link" itemprop="url">Red Black Tree</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2020-12-04 10:04:06" itemprop="dateCreated datePublished" datetime="2020-12-04T10:04:06+08:00">2020-12-04</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-08-17 09:46:48" itemprop="dateModified" datetime="2023-08-17T09:46:48+08:00">2023-08-17</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/" itemprop="url" rel="index"><span itemprop="name">数据结构</span></a>
        </span>
    </span>

  
</div>

            <div class="post-description">介绍红黑树的概念，及常用使用场景。</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h2 id="红黑树的定义"><a href="#红黑树的定义" class="headerlink" title="红黑树的定义"></a>红黑树的定义</h2><p>红黑树是一种自平衡二进制搜索树。每个节点存储一个代表颜色的标记位，用于在数的插入和删除期间保持数的近似平衡。红黑树是一个特殊的二叉树，用于组织可以进行比较的数据元素。</p>
<h2 id="红黑树的特点"><a href="#红黑树的特点" class="headerlink" title="红黑树的特点"></a>红黑树的特点</h2><ol>
<li>每个节点都必须是红色或者黑色；</li>
<li>跟节点是黑色。这条规则有时会被忽略，因为跟节点始终可以从红色变为黑色，但反过来就不一定成立。该规则对数据分析影响很小；</li>
<li>所有叶子节点（包括空节点）都是黑色；</li>
<li>红色节点的子节点都是黑色；</li>
<li>从给定节点到其任何后代NIL节点的每条路径都经过相同数量的黑色节点；</li>
</ol>
<p>参考链接：</p>
<ul>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://xlinux.nist.gov/dads/HTML/redblack.html">https://xlinux.nist.gov/dads/HTML/redblack.html</a></li>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://en.wikipedia.org/wiki/Red%E2%80%93black_tree">https://en.wikipedia.org/wiki/Red%E2%80%93black_tree</a></li>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://medium.com/@kevinsmavani007/red-black-tree-47e3249cf17">https://medium.com/@kevinsmavani007/red-black-tree-47e3249cf17</a></li>
</ul>

          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/2588.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/11962.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/11962.html" class="post-title-link" itemprop="url">Android Activity启动流程</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2020-11-29 14:12:05" itemprop="dateCreated datePublished" datetime="2020-11-29T14:12:05+08:00">2020-11-29</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-10-18 15:39:08" itemprop="dateModified" datetime="2023-10-18T15:39:08+08:00">2023-10-18</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/Android/" itemprop="url" rel="index"><span itemprop="name">Android</span></a>
        </span>
    </span>

  
</div>

            <div class="post-description">本文介绍Android Activity的启动流程</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h2 id="startActivity流程"><a href="#startActivity流程" class="headerlink" title="startActivity流程"></a>startActivity流程</h2><?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentstyletype="text/css" height="862px" preserveAspectRatio="none" style="width:1908px;height:862px;background:#FFFFFF;" version="1.1" viewBox="0 0 1908 862" width="1908px" zoomAndPan="magnify"><defs/><g><rect fill="#FFFFFF" height="751.0859" style="stroke:#181818;stroke-width:1.0;" width="10" x="105" y="67.4297"/><rect fill="#FFFFFF" height="713.9531" style="stroke:#181818;stroke-width:1.0;" width="10" x="110" y="104.5625"/><rect fill="#FFFFFF" height="679.8203" style="stroke:#181818;stroke-width:1.0;" width="10" x="267" y="138.6953"/><rect fill="#FFFFFF" height="650.6875" style="stroke:#181818;stroke-width:1.0;" width="10" x="410" y="167.8281"/><rect fill="#FFFFFF" height="561.2891" style="stroke:#181818;stroke-width:1.0;" width="10" x="517" y="196.9609"/><rect fill="#FFFFFF" height="524.1563" style="stroke:#181818;stroke-width:1.0;" width="10" x="522" y="234.0938"/><rect fill="#FFFFFF" height="9" style="stroke:#181818;stroke-width:1.0;" width="10" x="517" y="809.5156"/><rect fill="#FFFFFF" height="490.0234" style="stroke:#181818;stroke-width:1.0;" width="10" x="684" y="268.2266"/><rect fill="#FFFFFF" height="452.8906" style="stroke:#181818;stroke-width:1.0;" width="10" x="689" y="305.3594"/><rect fill="#FFFFFF" height="410.7578" style="stroke:#181818;stroke-width:1.0;" width="10" x="694" y="347.4922"/><rect fill="#FFFFFF" height="327.3281" style="stroke:#181818;stroke-width:1.0;" width="10" x="699" y="430.9219"/><rect fill="#FFFFFF" height="285.1953" style="stroke:#181818;stroke-width:1.0;" width="10" x="704" y="473.0547"/><rect fill="#FFFFFF" height="251.0625" style="stroke:#181818;stroke-width:1.0;" width="10" x="1035" y="507.1875"/><rect fill="#FFFFFF" height="98.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="1040" y="659.8516"/><rect fill="#FFFFFF" height="86.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="1300" y="536.3203"/><rect fill="#FFFFFF" height="49.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="1305" y="573.4531"/><rect fill="#FFFFFF" height="29.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="1522" y="693.9844"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="110" x2="110" y1="36.2969" y2="827.5156"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="271.5" x2="271.5" y1="36.2969" y2="827.5156"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="414.5" x2="414.5" y1="36.2969" y2="827.5156"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="521.5" x2="521.5" y1="36.2969" y2="827.5156"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="689" x2="689" y1="36.2969" y2="827.5156"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="875.5" x2="875.5" y1="391.1406" y2="827.5156"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="1039.5" x2="1039.5" y1="36.2969" y2="827.5156"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="1304.5" x2="1304.5" y1="36.2969" y2="827.5156"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="1526.5" x2="1526.5" y1="36.2969" y2="827.5156"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="1795" x2="1795" y1="36.2969" y2="827.5156"/><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="70" x="75" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="56" x="82" y="24.9951">Activity</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="70" x="75" y="826.5156"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="56" x="82" y="846.5107">Activity</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="131" x="206.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="117" x="213.5" y="24.9951">Instrumentation</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="131" x="206.5" y="826.5156"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="117" x="213.5" y="846.5107">Instrumentation</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="135" x="347.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="121" x="354.5" y="24.9951">IActivityManager</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="135" x="347.5" y="826.5156"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="121" x="354.5" y="846.5107">IActivityManager</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="45" x="499.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="31" x="506.5" y="24.9951">AMS</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="45" x="499.5" y="826.5156"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="31" x="506.5" y="846.5107">AMS</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="122" x="628" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="108" x="635" y="24.9951">ActivityStarter</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="122" x="628" y="826.5156"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="108" x="635" y="846.5107">ActivityStarter</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="121" x="815.5" y="826.5156"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="107" x="822.5" y="846.5107">ActivityRecord</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="187" x="946.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="173" x="953.5" y="24.9951">ActivityStackSupervisor</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="187" x="946.5" y="826.5156"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="173" x="953.5" y="846.5107">ActivityStackSupervisor</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="111" x="1249.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="97" x="1256.5" y="24.9951">ActivityStack</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="111" x="1249.5" y="826.5156"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="97" x="1256.5" y="846.5107">ActivityStack</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="147" x="1453.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="133" x="1460.5" y="24.9951">ApplicationThread</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="147" x="1453.5" y="826.5156"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="133" x="1460.5" y="846.5107">ApplicationThread</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="120" x="1735" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="106" x="1742" y="24.9951">ActivityThread</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="120" x="1735" y="826.5156"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="106" x="1742" y="846.5107">ActivityThread</text><rect fill="#FFFFFF" height="751.0859" style="stroke:#181818;stroke-width:1.0;" width="10" x="105" y="67.4297"/><rect fill="#FFFFFF" height="713.9531" style="stroke:#181818;stroke-width:1.0;" width="10" x="110" y="104.5625"/><rect fill="#FFFFFF" height="679.8203" style="stroke:#181818;stroke-width:1.0;" width="10" x="267" y="138.6953"/><rect fill="#FFFFFF" height="650.6875" style="stroke:#181818;stroke-width:1.0;" width="10" x="410" y="167.8281"/><rect fill="#FFFFFF" height="561.2891" style="stroke:#181818;stroke-width:1.0;" width="10" x="517" y="196.9609"/><rect fill="#FFFFFF" height="524.1563" style="stroke:#181818;stroke-width:1.0;" width="10" x="522" y="234.0938"/><rect fill="#FFFFFF" height="9" style="stroke:#181818;stroke-width:1.0;" width="10" x="517" y="809.5156"/><rect fill="#FFFFFF" height="490.0234" style="stroke:#181818;stroke-width:1.0;" width="10" x="684" y="268.2266"/><rect fill="#FFFFFF" height="452.8906" style="stroke:#181818;stroke-width:1.0;" width="10" x="689" y="305.3594"/><rect fill="#FFFFFF" height="410.7578" style="stroke:#181818;stroke-width:1.0;" width="10" x="694" y="347.4922"/><rect fill="#FFFFFF" height="327.3281" style="stroke:#181818;stroke-width:1.0;" width="10" x="699" y="430.9219"/><rect fill="#FFFFFF" height="285.1953" style="stroke:#181818;stroke-width:1.0;" width="10" x="704" y="473.0547"/><rect fill="#FFFFFF" height="251.0625" style="stroke:#181818;stroke-width:1.0;" width="10" x="1035" y="507.1875"/><rect fill="#FFFFFF" height="98.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="1040" y="659.8516"/><rect fill="#FFFFFF" height="86.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="1300" y="536.3203"/><rect fill="#FFFFFF" height="49.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="1305" y="573.4531"/><rect fill="#FFFFFF" height="29.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="1522" y="693.9844"/><ellipse cx="7.5" cy="66.6797" fill="none" rx="4" ry="4" style="stroke:#181818;stroke-width:1.5;"/><polygon fill="#181818" points="93,63.4297,103,67.4297,93,71.4297,97,67.4297" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="12" x2="99" y1="67.4297" y2="67.4297"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="78" x="15" y="62.3638">startActivity</text><line style="stroke:#181818;stroke-width:1.0;" x1="115" x2="162" y1="91.5625" y2="91.5625"/><line style="stroke:#181818;stroke-width:1.0;" x1="162" x2="162" y1="91.5625" y2="104.5625"/><line style="stroke:#181818;stroke-width:1.0;" x1="121" x2="162" y1="104.5625" y2="104.5625"/><polygon fill="#181818" points="131,100.5625,121,104.5625,131,108.5625,127,104.5625" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="138" x="127" y="86.4966">startActivityForResult</text><polygon fill="#181818" points="255,134.6953,265,138.6953,255,142.6953,259,138.6953" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="120" x2="261" y1="138.6953" y2="138.6953"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="110" x="127" y="133.6294">execStartActivity</text><polygon fill="#181818" points="398,163.8281,408,167.8281,398,171.8281,402,167.8281" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="277" x2="404" y1="167.8281" y2="167.8281"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="78" x="284" y="162.7622">startActivity</text><polygon fill="#181818" points="505,192.9609,515,196.9609,505,200.9609,509,196.9609" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="420" x2="511" y1="196.9609" y2="196.9609"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="78" x="427" y="191.895">startActivity</text><line style="stroke:#181818;stroke-width:1.0;" x1="527" x2="574" y1="221.0938" y2="221.0938"/><line style="stroke:#181818;stroke-width:1.0;" x1="574" x2="574" y1="221.0938" y2="234.0938"/><line style="stroke:#181818;stroke-width:1.0;" x1="533" x2="574" y1="234.0938" y2="234.0938"/><polygon fill="#181818" points="543,230.0938,533,234.0938,543,238.0938,539,234.0938" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="123" x="539" y="216.0278">startActivityAsUser</text><polygon fill="#181818" points="672,264.2266,682,268.2266,672,272.2266,676,268.2266" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="532" x2="678" y1="268.2266" y2="268.2266"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="133" x="539" y="263.1606">startActivityMayWait</text><line style="stroke:#181818;stroke-width:1.0;" x1="694" x2="741" y1="292.3594" y2="292.3594"/><line style="stroke:#181818;stroke-width:1.0;" x1="741" x2="741" y1="292.3594" y2="305.3594"/><line style="stroke:#181818;stroke-width:1.0;" x1="700" x2="741" y1="305.3594" y2="305.3594"/><polygon fill="#181818" points="710,301.3594,700,305.3594,710,309.3594,706,305.3594" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="123" x="706" y="287.2935">startActivityLocked</text><line style="stroke:#181818;stroke-width:1.0;" x1="699" x2="746" y1="334.4922" y2="334.4922"/><line style="stroke:#181818;stroke-width:1.0;" x1="746" x2="746" y1="334.4922" y2="347.4922"/><line style="stroke:#181818;stroke-width:1.0;" x1="705" x2="746" y1="347.4922" y2="347.4922"/><polygon fill="#181818" points="715,343.4922,705,347.4922,715,351.4922,711,347.4922" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="78" x="711" y="329.4263">startActivity</text><polygon fill="#181818" points="803.5,362.4922,813.5,366.4922,803.5,370.4922,807.5,366.4922" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="704" x2="809.5" y1="366.4922" y2="366.4922"/><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="121" x="815.5" y="360.4922"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="107" x="822.5" y="380.4873">ActivityRecord</text><line style="stroke:#181818;stroke-width:1.0;" x1="704" x2="751" y1="417.9219" y2="417.9219"/><line style="stroke:#181818;stroke-width:1.0;" x1="751" x2="751" y1="417.9219" y2="430.9219"/><line style="stroke:#181818;stroke-width:1.0;" x1="710" x2="751" y1="430.9219" y2="430.9219"/><polygon fill="#181818" points="720,426.9219,710,430.9219,720,434.9219,716,430.9219" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="78" x="716" y="412.856">startActivity</text><line style="stroke:#181818;stroke-width:1.0;" x1="709" x2="756" y1="460.0547" y2="460.0547"/><line style="stroke:#181818;stroke-width:1.0;" x1="756" x2="756" y1="460.0547" y2="473.0547"/><line style="stroke:#181818;stroke-width:1.0;" x1="715" x2="756" y1="473.0547" y2="473.0547"/><polygon fill="#181818" points="725,469.0547,715,473.0547,725,477.0547,721,473.0547" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="148" x="721" y="454.9888">startActivityUnchecked</text><polygon fill="#181818" points="1023,503.1875,1033,507.1875,1023,511.1875,1027,507.1875" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="714" x2="1029" y1="507.1875" y2="507.1875"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="254" x="721" y="502.1216">resumeFocusedStackTopActivityLocked</text><polygon fill="#181818" points="1288,532.3203,1298,536.3203,1288,540.3203,1292,536.3203" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="1045" x2="1294" y1="536.3203" y2="536.3203"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="236" x="1052" y="531.2544">resumeTopActivityUncheckedLocked</text><line style="stroke:#181818;stroke-width:1.0;" x1="1310" x2="1357" y1="560.4531" y2="560.4531"/><line style="stroke:#181818;stroke-width:1.0;" x1="1357" x2="1357" y1="560.4531" y2="573.4531"/><line style="stroke:#181818;stroke-width:1.0;" x1="1316" x2="1357" y1="573.4531" y2="573.4531"/><polygon fill="#181818" points="1326,569.4531,1316,573.4531,1326,577.4531,1322,573.4531" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="198" x="1322" y="555.3872">resumeTopActivityInnerLocked</text><polygon fill="#181818" points="1056,618.7188,1046,622.7188,1056,626.7188,1052,622.7188" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="1050" x2="1304" y1="622.7188" y2="622.7188"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="172" x="1062" y="602.52">startSpecificActivityLocked</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="143" x="1062" y="617.6528">&#20250;&#21028;&#26029;&#26159;&#21542;&#21551;&#21160;&#26032;&#30340;&#36827;&#31243;</text><line style="stroke:#181818;stroke-width:1.0;" x1="1045" x2="1092" y1="646.8516" y2="646.8516"/><line style="stroke:#181818;stroke-width:1.0;" x1="1092" x2="1092" y1="646.8516" y2="659.8516"/><line style="stroke:#181818;stroke-width:1.0;" x1="1051" x2="1092" y1="659.8516" y2="659.8516"/><polygon fill="#181818" points="1061,655.8516,1051,659.8516,1061,663.8516,1057,659.8516" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="148" x="1057" y="641.7856">realStartActivityLocked</text><polygon fill="#181818" points="1510,689.9844,1520,693.9844,1510,697.9844,1514,693.9844" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="1050" x2="1516" y1="693.9844" y2="693.9844"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="151" x="1057" y="688.9185">scheduleLaunchActivity</text><polygon fill="#181818" points="1783,719.1172,1793,723.1172,1783,727.1172,1787,723.1172" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="1527" x2="1789" y1="723.1172" y2="723.1172"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="239" x="1534" y="718.0513">sendMessage(H.LAUNCH_ACTIVITY, r)</text><line style="stroke:#181818;stroke-width:1.0;" x1="1795" x2="1837" y1="757.25" y2="757.25"/><line style="stroke:#181818;stroke-width:1.0;" x1="1837" x2="1837" y1="757.25" y2="770.25"/><line style="stroke:#181818;stroke-width:1.0;" x1="1790" x2="1837" y1="770.25" y2="770.25"/><polygon fill="#181818" points="1800,766.25,1790,770.25,1800,774.25,1796,770.25" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="99" x="1802" y="752.1841">handleMessage</text><polygon fill="#181818" points="538,805.5156,528,809.5156,538,813.5156,534,809.5156" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="532" x2="1039" y1="809.5156" y2="809.5156"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="125" x="544" y="789.3169">startProcessLocked</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="78" x="544" y="804.4497">&#38656;&#35201;&#21551;&#21160;&#36827;&#31243;</text><!--SRC=[nLJDIiGm4BxtANBptmVm82o2R64hOdSLKP2OZ6wm9YL9HMyA7aGldaJKeuWNqGSGV1btrRSmhUtQRRPbMGHlpSptVJFpPT8nr6OKq8uGUbiSEiw6c9b7DQBP0TD7Q6fg3YcDfSuYJYzL2LiKSWLK5EW-lCkLbj4-S8qr4poXmI4Glw_2c8NBbV8mnxiW4-ekQ1_a0IDWE19q93bo2q1dW9PhYw7Yc1Ocxi7p1nbYecN9ccefqqC6IQF9k0FBUlXe3RDVqpBaKEI687j0H-DMiLQ024dHvEJVIvUpMfoqOOXvo9uVXV4IA26DXZHBjm-BWaGAQ99kYh1W48wFM4EPZ5CcNwpSgvUhqUkxibX_2LiuySFITZa7QT_o085yqpEfitu8XEqmqk_69dz_lUcStNUldhhNpvtBXyxbS-VyiNlryd5p-lbs-_5uuL0OPeeAetAfT38S-DMhQ-c5OS18yeIRRSEdwSuOjsaKG0D7nlZVbRFGkPQoI6mCSEg1KkQ5ZzTd6xNMqa9zgxRGT5VTvleqaXDEaMJ9pA4svZI0LARKhDn-ZGo9z__VKfvVF5PTL_8tp1xriXJ4sFDposYJVzqTVpwS_6nQkcFP3toqZsy0]--></g></svg>

<h2 id="Activity启动流程"><a href="#Activity启动流程" class="headerlink" title="Activity启动流程"></a>Activity启动流程</h2><?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentstyletype="text/css" height="1451px" preserveAspectRatio="none" style="width:1495px;height:1451px;background:#FFFFFF;" version="1.1" viewBox="0 0 1495 1451" width="1495px" zoomAndPan="magnify"><defs/><g><rect fill="#FFFFFF" height="1287.6406" style="stroke:#181818;stroke-width:1.0;" width="10" x="143" y="119.6953"/><rect fill="#FFBBBB" height="648.4844" style="stroke:#181818;stroke-width:1.0;" width="10" x="148" y="247.0938"/><rect fill="#FFBBBB" height="467.625" style="stroke:#181818;stroke-width:1.0;" width="10" x="148" y="939.7109"/><rect fill="#FFFFFF" height="126.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="153" y="981.8438"/><rect fill="#FFFFFF" height="97.4297" style="stroke:#181818;stroke-width:1.0;" width="10" x="325" y="281.2266"/><rect fill="#FFFFFF" height="252.8281" style="stroke:#181818;stroke-width:1.0;" width="10" x="325" y="521.3516"/><rect fill="#FFFFFF" height="29.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="325" y="832.4453"/><rect fill="#FFFFFF" height="29.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="325" y="1045.1094"/><rect fill="#FFFFFF" height="84.4297" style="stroke:#181818;stroke-width:1.0;" width="10" x="494" y="407.7891"/><rect fill="#FFFFFF" height="209.6953" style="stroke:#181818;stroke-width:1.0;" width="10" x="494" y="550.4844"/><rect fill="#FFFFFF" height="151.5625" style="stroke:#181818;stroke-width:1.0;" width="10" x="499" y="587.6172"/><rect fill="#FFFFFF" height="72.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="494" y="803.3125"/><rect fill="#FFFFFF" height="72.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="494" y="1015.9766"/><rect fill="#FFFFFF" height="97.4297" style="stroke:#181818;stroke-width:1.0;" width="10" x="649" y="621.75"/><rect fill="#FFFFFF" height="253.9609" style="stroke:#181818;stroke-width:1.0;" width="10" x="975" y="1144.375"/><rect fill="#FFFFFF" height="56.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="1155" y="153.8281"/><rect fill="#FFFFFF" height="210.8281" style="stroke:#181818;stroke-width:1.0;" width="10" x="1155" y="1173.5078"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="148" x2="148" y1="36.2969" y2="1416.3359"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="329.5" x2="329.5" y1="36.2969" y2="1416.3359"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="499" x2="499" y1="362.0078" y2="1416.3359"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="653.5" x2="653.5" y1="446.4375" y2="1416.3359"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="842.5" x2="842.5" y1="660.3984" y2="1416.3359"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="979.5" x2="979.5" y1="36.2969" y2="1416.3359"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="1159.5" x2="1159.5" y1="36.2969" y2="1416.3359"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="1431.5" x2="1431.5" y1="1212.1563" y2="1416.3359"/><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="120" x="88" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="106" x="95" y="24.9951">ActivityThread</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="120" x="88" y="1415.3359"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="106" x="95" y="1435.3311">ActivityThread</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="131" x="264.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="117" x="271.5" y="24.9951">Instrumentation</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="131" x="264.5" y="1415.3359"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="117" x="271.5" y="1435.3311">Instrumentation</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="70" x="464" y="1415.3359"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="56" x="471" y="1435.3311">Activity</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="115" x="596.5" y="1415.3359"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="101" x="603.5" y="1435.3311">PhoneWindow</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="91" x="797.5" y="1415.3359"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="77" x="804.5" y="1435.3311">DecorView</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="163" x="898.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="149" x="905.5" y="24.9951">WindowManagerImpl</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="163" x="898.5" y="1415.3359"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="149" x="905.5" y="1435.3311">WindowManagerImpl</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="177" x="1071.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="163" x="1078.5" y="24.9951">WindowManagerGlobal</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="177" x="1071.5" y="1415.3359"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="163" x="1078.5" y="1435.3311">WindowManagerGlobal</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="115" x="1374.5" y="1415.3359"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="101" x="1381.5" y="1435.3311">ViewRootImpl</text><rect fill="#FFFFFF" height="1287.6406" style="stroke:#181818;stroke-width:1.0;" width="10" x="143" y="119.6953"/><rect fill="#FFBBBB" height="648.4844" style="stroke:#181818;stroke-width:1.0;" width="10" x="148" y="247.0938"/><rect fill="#FFBBBB" height="467.625" style="stroke:#181818;stroke-width:1.0;" width="10" x="148" y="939.7109"/><rect fill="#FFFFFF" height="126.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="153" y="981.8438"/><rect fill="#FFFFFF" height="97.4297" style="stroke:#181818;stroke-width:1.0;" width="10" x="325" y="281.2266"/><rect fill="#FFFFFF" height="252.8281" style="stroke:#181818;stroke-width:1.0;" width="10" x="325" y="521.3516"/><rect fill="#FFFFFF" height="29.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="325" y="832.4453"/><rect fill="#FFFFFF" height="29.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="325" y="1045.1094"/><rect fill="#FFFFFF" height="84.4297" style="stroke:#181818;stroke-width:1.0;" width="10" x="494" y="407.7891"/><rect fill="#FFFFFF" height="209.6953" style="stroke:#181818;stroke-width:1.0;" width="10" x="494" y="550.4844"/><rect fill="#FFFFFF" height="151.5625" style="stroke:#181818;stroke-width:1.0;" width="10" x="499" y="587.6172"/><rect fill="#FFFFFF" height="72.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="494" y="803.3125"/><rect fill="#FFFFFF" height="72.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="494" y="1015.9766"/><rect fill="#FFFFFF" height="97.4297" style="stroke:#181818;stroke-width:1.0;" width="10" x="649" y="621.75"/><rect fill="#FFFFFF" height="253.9609" style="stroke:#181818;stroke-width:1.0;" width="10" x="975" y="1144.375"/><rect fill="#FFFFFF" height="56.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="1155" y="153.8281"/><rect fill="#FFFFFF" height="210.8281" style="stroke:#181818;stroke-width:1.0;" width="10" x="1155" y="1173.5078"/><ellipse cx="7.5" cy="81.8125" fill="none" rx="4" ry="4" style="stroke:#181818;stroke-width:1.5;"/><polygon fill="#181818" points="136,78.5625,146,82.5625,136,86.5625,140,82.5625" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="12" x2="142" y1="82.5625" y2="82.5625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="103" x="15" y="62.3638">handleMessage.</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="116" x="15" y="77.4966">LAUNCH_ACTIVITY</text><line style="stroke:#181818;stroke-width:1.0;" x1="148" x2="195" y1="106.6953" y2="106.6953"/><line style="stroke:#181818;stroke-width:1.0;" x1="195" x2="195" y1="106.6953" y2="119.6953"/><line style="stroke:#181818;stroke-width:1.0;" x1="154" x2="195" y1="119.6953" y2="119.6953"/><polygon fill="#181818" points="164,115.6953,154,119.6953,164,123.6953,160,119.6953" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="137" x="160" y="101.6294">handleLaunchActivity</text><polygon fill="#181818" points="1143,149.8281,1153,153.8281,1143,157.8281,1147,153.8281" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="153" x2="1149" y1="153.8281" y2="153.8281"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="51" x="160" y="148.7622">initialize</text><line style="stroke:#181818;stroke-width:1.0;" x1="1165" x2="1207" y1="182.9609" y2="182.9609"/><line style="stroke:#181818;stroke-width:1.0;" x1="1207" x2="1207" y1="182.9609" y2="195.9609"/><line style="stroke:#181818;stroke-width:1.0;" x1="1166" x2="1207" y1="195.9609" y2="195.9609"/><polygon fill="#181818" points="1176,191.9609,1166,195.9609,1176,199.9609,1172,195.9609" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="248" x="1172" y="177.895">ServiceManager.getService("window"))</text><polygon fill="#181818" points="164,205.9609,154,209.9609,164,213.9609,160,209.9609" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="158" x2="1159" y1="209.9609" y2="209.9609"/><line style="stroke:#181818;stroke-width:1.0;" x1="153" x2="200" y1="234.0938" y2="234.0938"/><line style="stroke:#181818;stroke-width:1.0;" x1="200" x2="200" y1="234.0938" y2="247.0938"/><line style="stroke:#181818;stroke-width:1.0;" x1="159" x2="200" y1="247.0938" y2="247.0938"/><polygon fill="#181818" points="169,243.0938,159,247.0938,169,251.0938,165,247.0938" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="146" x="165" y="229.0278">performLaunchActivity</text><polygon fill="#181818" points="313,277.2266,323,281.2266,313,285.2266,317,281.2266" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="158" x2="319" y1="281.2266" y2="281.2266"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="75" x="165" y="276.1606">newActivity</text><line style="stroke:#181818;stroke-width:1.0;" x1="335" x2="377" y1="310.3594" y2="310.3594"/><line style="stroke:#181818;stroke-width:1.0;" x1="377" x2="377" y1="310.3594" y2="323.3594"/><line style="stroke:#181818;stroke-width:1.0;" x1="336" x2="377" y1="323.3594" y2="323.3594"/><polygon fill="#181818" points="346,319.3594,336,323.3594,346,327.3594,342,323.3594" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="143" x="342" y="305.2935">ClassLoader.loadClass</text><polygon fill="#181818" points="452,348.4922,462,352.4922,452,356.4922,456,352.4922" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="335" x2="458" y1="352.4922" y2="352.4922"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="81" x="342" y="347.4263">newInstance</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="70" x="464" y="331.3594"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="56" x="471" y="351.3545">Activity</text><polygon fill="#181818" points="169,374.6563,159,378.6563,169,382.6563,165,378.6563" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="163" x2="329" y1="378.6563" y2="378.6563"/><polygon fill="#181818" points="482,403.7891,492,407.7891,482,411.7891,486,407.7891" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="158" x2="488" y1="407.7891" y2="407.7891"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="41" x="165" y="402.7231">attach</text><polygon fill="#181818" points="584.5,432.9219,594.5,436.9219,584.5,440.9219,588.5,436.9219" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="504" x2="590.5" y1="436.9219" y2="436.9219"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="64" x="511" y="431.856">mWindow</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="115" x="596.5" y="415.7891"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="101" x="603.5" y="435.7842">PhoneWindow</text><polygon fill="#181818" points="642,474.2188,652,478.2188,642,482.2188,646,478.2188" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="504" x2="648" y1="478.2188" y2="478.2188"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="126" x="511" y="473.1528">setWindowManager</text><polygon fill="#181818" points="169,488.2188,159,492.2188,169,496.2188,165,492.2188" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="163" x2="498" y1="492.2188" y2="492.2188"/><polygon fill="#181818" points="313,517.3516,323,521.3516,313,525.3516,317,521.3516" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="158" x2="319" y1="521.3516" y2="521.3516"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="130" x="165" y="516.2856">callActivityOnCreate</text><polygon fill="#181818" points="482,546.4844,492,550.4844,482,554.4844,486,550.4844" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="335" x2="488" y1="550.4844" y2="550.4844"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="95" x="342" y="545.4185">performCreate</text><line style="stroke:#181818;stroke-width:1.0;" x1="504" x2="551" y1="574.6172" y2="574.6172"/><line style="stroke:#181818;stroke-width:1.0;" x1="551" x2="551" y1="574.6172" y2="587.6172"/><line style="stroke:#181818;stroke-width:1.0;" x1="510" x2="551" y1="587.6172" y2="587.6172"/><polygon fill="#181818" points="520,583.6172,510,587.6172,520,591.6172,516,587.6172" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="59" x="516" y="569.5513">onCreate</text><polygon fill="#181818" points="637,617.75,647,621.75,637,625.75,641,621.75" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="509" x2="643" y1="621.75" y2="621.75"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="102" x="516" y="616.6841">setContentView</text><polygon fill="#181818" points="785.5,631.75,795.5,635.75,785.5,639.75,789.5,635.75" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="659" x2="791.5" y1="635.75" y2="635.75"/><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="91" x="797.5" y="629.75"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="77" x="804.5" y="649.7451">DecorView</text><line style="stroke:#181818;stroke-width:1.0;" x1="659" x2="701" y1="692.1797" y2="692.1797"/><line style="stroke:#181818;stroke-width:1.0;" x1="701" x2="701" y1="692.1797" y2="705.1797"/><line style="stroke:#181818;stroke-width:1.0;" x1="660" x2="701" y1="705.1797" y2="705.1797"/><polygon fill="#181818" points="670,701.1797,660,705.1797,670,709.1797,666,705.1797" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="165" x="666" y="687.1138">mContentParent.addView</text><polygon fill="#181818" points="520,715.1797,510,719.1797,520,723.1797,516,719.1797" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="514" x2="653" y1="719.1797" y2="719.1797"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="509" x2="551" y1="738.1797" y2="738.1797"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="551" x2="551" y1="738.1797" y2="751.1797"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="504" x2="551" y1="751.1797" y2="751.1797"/><polygon fill="#181818" points="514,747.1797,504,751.1797,514,755.1797,510,751.1797" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="346,756.1797,336,760.1797,346,764.1797,342,760.1797" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="340" x2="498" y1="760.1797" y2="760.1797"/><polygon fill="#181818" points="169,770.1797,159,774.1797,169,778.1797,165,774.1797" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="163" x2="329" y1="774.1797" y2="774.1797"/><polygon fill="#181818" points="482,799.3125,492,803.3125,482,807.3125,486,803.3125" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="158" x2="488" y1="803.3125" y2="803.3125"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="83" x="165" y="798.2466">performStart</text><polygon fill="#181818" points="346,828.4453,336,832.4453,346,836.4453,342,832.4453" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="340" x2="493" y1="832.4453" y2="832.4453"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="118" x="352" y="827.3794">callActivityOnStart</text><polygon fill="#181818" points="482,857.5781,492,861.5781,482,865.5781,486,861.5781" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="330" x2="488" y1="861.5781" y2="861.5781"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="47" x="337" y="856.5122">onStart</text><polygon fill="#181818" points="169,871.5781,159,875.5781,169,879.5781,165,875.5781" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="163" x2="498" y1="875.5781" y2="875.5781"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="158" x2="200" y1="894.5781" y2="894.5781"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="200" x2="200" y1="894.5781" y2="907.5781"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="153" x2="200" y1="907.5781" y2="907.5781"/><polygon fill="#181818" points="163,903.5781,153,907.5781,163,911.5781,159,907.5781" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="153" x2="200" y1="926.7109" y2="926.7109"/><line style="stroke:#181818;stroke-width:1.0;" x1="200" x2="200" y1="926.7109" y2="939.7109"/><line style="stroke:#181818;stroke-width:1.0;" x1="159" x2="200" y1="939.7109" y2="939.7109"/><polygon fill="#181818" points="169,935.7109,159,939.7109,169,943.7109,165,939.7109" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="144" x="165" y="921.645">handleResumeActivity</text><line style="stroke:#181818;stroke-width:1.0;" x1="158" x2="205" y1="968.8438" y2="968.8438"/><line style="stroke:#181818;stroke-width:1.0;" x1="205" x2="205" y1="968.8438" y2="981.8438"/><line style="stroke:#181818;stroke-width:1.0;" x1="164" x2="205" y1="981.8438" y2="981.8438"/><polygon fill="#181818" points="174,977.8438,164,981.8438,174,985.8438,170,981.8438" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="153" x="170" y="963.7778">performResumeActivity</text><polygon fill="#181818" points="482,1011.9766,492,1015.9766,482,1019.9766,486,1015.9766" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="163" x2="488" y1="1015.9766" y2="1015.9766"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="105" x="170" y="1010.9106">performResume</text><polygon fill="#181818" points="346,1041.1094,336,1045.1094,346,1049.1094,342,1045.1094" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="340" x2="493" y1="1045.1094" y2="1045.1094"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="140" x="352" y="1040.0435">callActivityOnResume</text><polygon fill="#181818" points="482,1070.2422,492,1074.2422,482,1078.2422,486,1074.2422" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="330" x2="488" y1="1074.2422" y2="1074.2422"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="69" x="337" y="1069.1763">onResume</text><polygon fill="#181818" points="174,1084.2422,164,1088.2422,174,1092.2422,170,1088.2422" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="168" x2="498" y1="1088.2422" y2="1088.2422"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="163" x2="205" y1="1107.2422" y2="1107.2422"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="205" x2="205" y1="1107.2422" y2="1120.2422"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="158" x2="205" y1="1120.2422" y2="1120.2422"/><polygon fill="#181818" points="168,1116.2422,158,1120.2422,168,1124.2422,164,1120.2422" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="963,1140.375,973,1144.375,963,1148.375,967,1144.375" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="158" x2="969" y1="1144.375" y2="1144.375"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="132" x="165" y="1139.3091">addView(decorView)</text><polygon fill="#181818" points="1143,1169.5078,1153,1173.5078,1143,1177.5078,1147,1173.5078" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="985" x2="1149" y1="1173.5078" y2="1173.5078"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="55" x="992" y="1168.4419">addView</text><polygon fill="#181818" points="1362.5,1183.5078,1372.5,1187.5078,1362.5,1191.5078,1366.5,1187.5078" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="1165" x2="1368.5" y1="1187.5078" y2="1187.5078"/><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="115" x="1374.5" y="1181.5078"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="101" x="1381.5" y="1201.5029">ViewRootImpl</text><line style="stroke:#181818;stroke-width:1.0;" x1="1165" x2="1207" y1="1243.9375" y2="1243.9375"/><line style="stroke:#181818;stroke-width:1.0;" x1="1207" x2="1207" y1="1243.9375" y2="1256.9375"/><line style="stroke:#181818;stroke-width:1.0;" x1="1166" x2="1207" y1="1256.9375" y2="1256.9375"/><polygon fill="#181818" points="1176,1252.9375,1166,1256.9375,1176,1260.9375,1172,1256.9375" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="119" x="1172" y="1238.8716">mViews.add(view)</text><line style="stroke:#181818;stroke-width:1.0;" x1="1165" x2="1207" y1="1286.0703" y2="1286.0703"/><line style="stroke:#181818;stroke-width:1.0;" x1="1207" x2="1207" y1="1286.0703" y2="1299.0703"/><line style="stroke:#181818;stroke-width:1.0;" x1="1166" x2="1207" y1="1299.0703" y2="1299.0703"/><polygon fill="#181818" points="1176,1295.0703,1166,1299.0703,1176,1303.0703,1172,1299.0703" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="114" x="1172" y="1281.0044">mRoots.add(root)</text><line style="stroke:#181818;stroke-width:1.0;" x1="1165" x2="1207" y1="1328.2031" y2="1328.2031"/><line style="stroke:#181818;stroke-width:1.0;" x1="1207" x2="1207" y1="1328.2031" y2="1341.2031"/><line style="stroke:#181818;stroke-width:1.0;" x1="1166" x2="1207" y1="1341.2031" y2="1341.2031"/><polygon fill="#181818" points="1176,1337.2031,1166,1341.2031,1176,1345.2031,1172,1341.2031" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="160" x="1172" y="1323.1372">mParams.add(wparams)</text><polygon fill="#181818" points="1420,1366.3359,1430,1370.3359,1420,1374.3359,1424,1370.3359" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="1165" x2="1426" y1="1370.3359" y2="1370.3359"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="51" x="1172" y="1365.27">setView</text><polygon fill="#181818" points="996,1380.3359,986,1384.3359,996,1388.3359,992,1384.3359" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="990" x2="1159" y1="1384.3359" y2="1384.3359"/><polygon fill="#181818" points="169,1394.3359,159,1398.3359,169,1402.3359,165,1398.3359" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="163" x2="979" y1="1398.3359" y2="1398.3359"/><!--SRC=[bLHHRvim47xdLvpQXoQD4dMFvM5IojGrKjfLRTffMgNg2jTY2MnadB3jryzWWq8mWUOXWFrzT_TzzjqPn2mYU1T2lOa_NePIiP1bo1NyP3mInIro_23vFH5lc82G4Kcul6m1dnaL3ph0Airgn9UB2y_xBUPVOHagjcFgxoQMX17u42EF4hgbFDTn5ozylNow2svUby5czRpQ_F8E2DqGiraJPOrR7iRrleFgqZ2R-S0uKmmJzeyy5wI7wGCyajonaEpwueEKNPcS51NZP3hr9AcjvAEKd5vVN-cV3nd9To7JGKKhdYkvJOahL4nmumQdeg4S0XmS7u84ytmjK9_L8j6Fwjj5hSF2-Rd9KsAGXpGiqfI6Ic4ODx0IS1yBJiPV4pOr7xqW7t9IhGFfpzxrnuSGawH6_k21XYewAhQgt9w8XU_NriO9xe3ibr-Me0K4WYkThUmMRtzRexzHA6IveVqut6iRaTeezoZr_mAZg8fdxN0-Xax8wdnKkgLR6fnNhUsb8HspSZwlB3B0Cp0rDGjZAtKqZ9a03vJhn4VwnJKyhEBHN0ThmAX3donfX54MEMHCgnkgmLicjTTX4jNtQUfrWRrZ4Pe0VKEnDUdrLVtKx4nBTbvUsSckMzeWkynhs5A_VPQj-mLJGo-owdqwIcJLkTqM-my0]--></g></svg>

<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentstyletype="text/css" height="203px" preserveAspectRatio="none" style="width:372px;height:203px;background:#FFFFFF;" version="1.1" viewBox="0 0 372 203" width="372px" zoomAndPan="magnify"><defs/><g><!--class WindowManagerGlobal--><g id="elem_WindowManagerGlobal"><rect codeline="1" fill="#F1F1F1" height="80.5938" id="WindowManagerGlobal" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="259" x="101.5" y="7"/><ellipse cx="145.3" cy="23" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M147.6438,18.6719 C146.7063,18.2344 146.1125,18.0938 145.2375,18.0938 C142.6125,18.0938 140.6125,20.1719 140.6125,22.8906 L140.6125,24.0156 C140.6125,26.5938 142.7219,28.4844 145.6125,28.4844 C146.8313,28.4844 147.9875,28.1875 148.7375,27.6406 C149.3156,27.2344 149.6438,26.7813 149.6438,26.3906 C149.6438,25.9375 149.2531,25.5469 148.7844,25.5469 C148.5656,25.5469 148.3625,25.625 148.175,25.8125 C147.7219,26.2969 147.7219,26.2969 147.5344,26.3906 C147.1125,26.6563 146.425,26.7813 145.6594,26.7813 C143.6125,26.7813 142.3156,25.6875 142.3156,23.9844 L142.3156,22.8906 C142.3156,21.1094 143.5656,19.7969 145.3,19.7969 C145.8781,19.7969 146.4875,19.9531 146.9563,20.2031 C147.4406,20.4844 147.6125,20.7031 147.7063,21.1094 C147.7688,21.5156 147.8,21.6406 147.9406,21.7656 C148.0813,21.9063 148.3156,22.0156 148.5344,22.0156 C148.8,22.0156 149.0656,21.875 149.2375,21.6563 C149.3469,21.5 149.3781,21.3125 149.3781,20.8906 L149.3781,19.4688 C149.3781,19.0313 149.3625,18.9063 149.2688,18.75 C149.1125,18.4844 148.8313,18.3438 148.5344,18.3438 C148.2375,18.3438 148.0344,18.4375 147.8156,18.75 L147.6438,18.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="163" x="165.7" y="27.8467">WindowManagerGlobal</text><line style="stroke:#181818;stroke-width:0.5;" x1="102.5" x2="359.5" y1="39" y2="39"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="184" x="107.5" y="55.9951">ArrayList&lt;View&gt; mViews;</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="247" x="107.5" y="72.292">ArrayList&lt;ViewRootImpl&gt; mRoots</text><line style="stroke:#181818;stroke-width:0.5;" x1="102.5" x2="359.5" y1="79.5938" y2="79.5938"/></g><!--class View--><g id="elem_View"><rect fill="#F1F1F1" height="48" id="View" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="66" x="131" y="148"/><ellipse cx="146" cy="164" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M148.3438,159.6719 C147.4063,159.2344 146.8125,159.0938 145.9375,159.0938 C143.3125,159.0938 141.3125,161.1719 141.3125,163.8906 L141.3125,165.0156 C141.3125,167.5938 143.4219,169.4844 146.3125,169.4844 C147.5313,169.4844 148.6875,169.1875 149.4375,168.6406 C150.0156,168.2344 150.3438,167.7813 150.3438,167.3906 C150.3438,166.9375 149.9531,166.5469 149.4844,166.5469 C149.2656,166.5469 149.0625,166.625 148.875,166.8125 C148.4219,167.2969 148.4219,167.2969 148.2344,167.3906 C147.8125,167.6563 147.125,167.7813 146.3594,167.7813 C144.3125,167.7813 143.0156,166.6875 143.0156,164.9844 L143.0156,163.8906 C143.0156,162.1094 144.2656,160.7969 146,160.7969 C146.5781,160.7969 147.1875,160.9531 147.6563,161.2031 C148.1406,161.4844 148.3125,161.7031 148.4063,162.1094 C148.4688,162.5156 148.5,162.6406 148.6406,162.7656 C148.7813,162.9063 149.0156,163.0156 149.2344,163.0156 C149.5,163.0156 149.7656,162.875 149.9375,162.6563 C150.0469,162.5 150.0781,162.3125 150.0781,161.8906 L150.0781,160.4688 C150.0781,160.0313 150.0625,159.9063 149.9688,159.75 C149.8125,159.4844 149.5313,159.3438 149.2344,159.3438 C148.9375,159.3438 148.7344,159.4375 148.5156,159.75 L148.3438,159.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="34" x="160" y="168.8467">View</text><line style="stroke:#181818;stroke-width:0.5;" x1="132" x2="196" y1="180" y2="180"/><line style="stroke:#181818;stroke-width:0.5;" x1="132" x2="196" y1="188" y2="188"/></g><g id="elem_GMN5"><path d="M6,159.5 L6,184.6328 A0,0 0 0 0 6,184.6328 L96,184.6328 A0,0 0 0 0 96,184.6328 L96,177.5 L130.808,172 L96,169.5 L96,169.5 L86,159.5 L6,159.5 A0,0 0 0 0 6,159.5 " fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M86,159.5 L86,169.5 L96,169.5 L86,159.5 " fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="69" x="12" y="176.5669">DecorView</text></g><!--class ViewRootImpl--><g id="elem_ViewRootImpl"><rect fill="#F1F1F1" height="48" id="ViewRootImpl" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="133" x="232.5" y="148"/><ellipse cx="247.5" cy="164" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M249.8438,159.6719 C248.9063,159.2344 248.3125,159.0938 247.4375,159.0938 C244.8125,159.0938 242.8125,161.1719 242.8125,163.8906 L242.8125,165.0156 C242.8125,167.5938 244.9219,169.4844 247.8125,169.4844 C249.0313,169.4844 250.1875,169.1875 250.9375,168.6406 C251.5156,168.2344 251.8438,167.7813 251.8438,167.3906 C251.8438,166.9375 251.4531,166.5469 250.9844,166.5469 C250.7656,166.5469 250.5625,166.625 250.375,166.8125 C249.9219,167.2969 249.9219,167.2969 249.7344,167.3906 C249.3125,167.6563 248.625,167.7813 247.8594,167.7813 C245.8125,167.7813 244.5156,166.6875 244.5156,164.9844 L244.5156,163.8906 C244.5156,162.1094 245.7656,160.7969 247.5,160.7969 C248.0781,160.7969 248.6875,160.9531 249.1563,161.2031 C249.6406,161.4844 249.8125,161.7031 249.9063,162.1094 C249.9688,162.5156 250,162.6406 250.1406,162.7656 C250.2813,162.9063 250.5156,163.0156 250.7344,163.0156 C251,163.0156 251.2656,162.875 251.4375,162.6563 C251.5469,162.5 251.5781,162.3125 251.5781,161.8906 L251.5781,160.4688 C251.5781,160.0313 251.5625,159.9063 251.4688,159.75 C251.3125,159.4844 251.0313,159.3438 250.7344,159.3438 C250.4375,159.3438 250.2344,159.4375 250.0156,159.75 L249.8438,159.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="101" x="261.5" y="168.8467">ViewRootImpl</text><line style="stroke:#181818;stroke-width:0.5;" x1="233.5" x2="364.5" y1="180" y2="180"/><line style="stroke:#181818;stroke-width:0.5;" x1="233.5" x2="364.5" y1="188" y2="188"/></g><!--reverse link WindowManagerGlobal to View--><g id="link_WindowManagerGlobal_View"><path codeline="5" d="M203.4889,98.8002 C192.7139,118.5014 185.84,131.0687 176.666,147.8428 " fill="none" id="WindowManagerGlobal-backto-View" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="209.247,88.272,202.8585,91.6168,203.4889,98.8002,209.8774,95.4555,209.247,88.272" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="8" x="197.3036" y="107.7718">1</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="8" x="170.8867" y="136.8146">n</text></g><!--reverse link WindowManagerGlobal to ViewRootImpl--><g id="link_WindowManagerGlobal_ViewRootImpl"><path codeline="7" d="M258.902,98.7639 C269.838,118.4651 276.834,131.0687 286.145,147.8428 " fill="none" id="WindowManagerGlobal-backto-ViewRootImpl" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="253.078,88.272,252.4927,95.4593,258.902,98.7639,259.4873,91.5766,253.078,88.272" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="8" x="247.8462" y="107.7718">1</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="8" x="273.8259" y="136.8146">n</text></g><!--SRC=[Iyv9B2vM2C_CIyalzqtCIqnFBNBFoKzAp56evb800iUYeiHAdypY4fkmpDHoEuLS45LiZKKkA3-_n3Et80Ue1iGivghbmcQiag6IWfQkhe9Idf82I1jNNdv9ga9EQbg9GduQM4J1Ii4bDJc_22nBZ14mcm40]--></g></svg>

          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/11962.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




  <nav class="pagination">
    <a class="extend prev" rel="prev" title="上一页" aria-label="上一页" href="/page/3/"><i class="fa fa-angle-left"></i></a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/3/">3</a><span class="page-number current">4</span><a class="page-number" href="/page/5/">5</a><span class="space">&hellip;</span><a class="page-number" href="/page/7/">7</a><a class="extend next" rel="next" title="下一页" aria-label="下一页" href="/page/5/"><i class="fa fa-angle-right"></i></a>
  </nav>

</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="copyright">
    &copy; 
    <span itemprop="copyrightYear">2024</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">Jason</span>
  </div>
  <div class="powered-by">由 <a href="https://hexo.io/" rel="noopener external nofollow noreferrer" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/pisces/" rel="noopener external nofollow noreferrer" target="_blank">NexT.Pisces</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/next-theme-pjax/0.6.0/pjax.min.js" integrity="sha256-vxLn1tSKWD4dqbMRyv940UYw4sXgMtYcK6reefzZrao=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.24/fancybox/fancybox.umd.js" integrity="sha256-oyhjPiYRWGXaAt+ny/mTMWOnN1GBoZDUQnzzgC7FRI4=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script><script src="/js/pjax.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>


  <script class="next-config" data-name="mermaid" type="application/json">{"enable":true,"theme":{"light":"default","dark":"dark"},"js":{"url":"https://cdnjs.cloudflare.com/ajax/libs/mermaid/10.5.0/mermaid.min.js","integrity":"sha256-K7oJiQlDulzl24ZUFOywuYme1JqBBvQzK6m8qHjt9Gk="}}</script>
  <script type="module" src="/js/zenuml-definition-074a43fa.js"></script>
  <script type="module" src="/js/mermaid-zenuml.esm.min.mjs"></script>
  <script src="/js/third-party/tags/mermaid.js"></script>


  <script src="/js/third-party/fancybox.js"></script>



  




  

  <script class="next-config" data-name="enableMath" type="application/json">true</script><script class="next-config" data-name="mathjax" type="application/json">{"enable":true,"tags":"none","js":{"url":"https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js","integrity":"sha256-MASABpB4tYktI2Oitl4t+78w/lyA+D7b/s9GEP0JOGI="}}</script>
<script src="/js/third-party/math/mathjax.js"></script>



</body>
</html>
